Hello everyone.
I've been facing an issue to implement scaling to my system. The system consists of buying a certain TICKER conditioned to a Bollinger Breakout entry signal and scale in up to two additional entries, which depend on the value of the first entry. The first entry is the breakout of a BBandBot(C,20,2) and two remaining entries would be nothing more than the breakout of BBandBot(?,20,3) and BBandBot(?,20,4), but considering the value of the first entry and not de CLOSE value of the bar. I don't know how to store the first entry value to make these two additional entries dependant on it.
Find my code below:
SetOption( "InitialEquity", 20000 );
MaxPos = 5;
SetOption( "MaxOpenPositions", MaxPos );
BS=BBandTop(C,20,2);
E1=BBandBot(C,20,2);
E2=BBandBot(C,20,3);
E3=BBandBot(C,20,4);
Buy=L<E1;
BuyPrice=E1;
Sell=H>=MA(C,20);
SellPrice =MA(C,20);
//Buy = ExRem( Buy, Sell ); // clear out excesive signals, if we are already bought
//Sell = ExRem( Sell, Buy ); // clear out excesive signals, if we are already sold
//PlotShapes(Buy*shapeUpArrow,colorBrightGreen,0);
//PlotShapes(Sell*shapeDownArrow,colorRed,0);
Plot(E1,"E1",colorAqua,0);
Plot(E2,"E2",colorYellow,0);
Plot(E3,"E3",colorBrown,0);
Plot(BS,"BS",colorAqua,0);
Plot(MA(C,20),"MA",colorWhite,0);
Any help or comments are appreciated.
RDCAmaral.