Your BuyPrice = SellPrice = O; is the current bar and you are trading on the bar before the current bar use BuyPrice = SellPrice = Ref(O,-1);
Jim Hutchison From: [email protected] [mailto:[email protected]] On Behalf Of hjansenvanrensburg Sent: Sunday, December 06, 2009 11:20 PM To: [email protected] Subject: [amibroker] Chart Signals Disappear when Interacting with Chart Hi, I have noticed that chart signals sometimes disappear when I interact with the chart, e.g. when I click on it or scroll it. Here is an example of a script where this problem occurs: // Script Start SetPositionSize(20, spsPercentOfEquity); SetTradeDelays(1, 1, 1, 1); BuyPrice = SellPrice = O; HHP = 16; LLP = 5; HH = Ref(HHV(C, HHP), -1); LL = Ref(LLV(C, LLP), -1); Buy = Cross(C, LL) AND BarCount > 248 * 2; Sell = Cross(HH, C); Buy = ExRem(Buy, Sell); Sell = ExRem(Sell, Buy); Plot(HH, "HH", colorLightBlue, styleLine); Plot(LL, "LL", colorLightOrange, styleLine); PlotShapes(shapeUpArrow * Buy, colorBrightGreen); PlotShapes(shapeDownArrow * Sell, colorRed // Script End Can anyone assist with this, please? HNJ van Rensburg
