amibroker - Whatever I do the Buy signals just gravitate to OBV number 0 as shown in picture - Stack Overflow

Is it possible to have a Buy signal when the OBV crosses my Bottom line (Green Line) which stays in the

Is it possible to have a Buy signal when the OBV crosses my Bottom line (Green Line) which stays in the same position. The Buy signals seem to only show up where the OBV is at number 0. enter image description here

TopLevel = 50000;  // Static upper threshold
BottomLevel = -50000;  // Static lower threshold
Top1 = 40000;
Bottom1 = -40000;
obvValue = OBV();
Buffer = 500;  // A buffer for noise filtering (adjustable value)
Plot(TopLevel, "Top Static Line", colorRed, styleLine | styleNoLine | styleNoTitle);
Plot(BottomLevel, "Bottom Static Line", colorGreen, styleLine | styleNoLine | styleNoTitle);
Plot(obvValue, "OBV", colorBlue, styleLine | styleOwnScale | styleThick);  // Plot OBV line for debugging
Plot(Top1, "Top Static Line", colorRed, styleLine | styleThick | styleNoTitle);
Plot(Bottom1, "Bottom Static Line", colorGreen, styleLine | styleThick | styleNoTitle);
BuySignal = Cross(obvValue, Bottom1 + Buffer) AND obvValue < Bottom1 - Buffer;
SellSignal = Cross(Top1 - Buffer, obvValue) AND obvValue > Top1 + Buffer;
Plot( IIf(BuySignal, obvValue, Null), "Buy Signal", colorGreen, styleHistogram | styleNoTitle );
Plot( IIf(SellSignal, obvValue, Null), "Sell Signal", colorRed, styleHistogram | styleNoTitle );
Plot(obvValue, "Debug OBV", colorYellow, styleLine | styleOwnScale | styleDashed);
Title = EncodeColor(colorWhite) + "OBV: " + WriteVal(obvValue, 1.2) +
        " | TopLevel: " + WriteVal(TopLevel, 1.2) +
        " | BottomLevel: " + WriteVal(BottomLevel, 1.2);

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745575502a4633937.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信