Hello, I have learned to scalein according to some levels.
Now I'm going crazy to know how to indicate a different sell depending on the level at which the price is.
I put an example in an image so that it is better understood and I enclose the code that I have prepared and that it would only need to indicate different outputs.
Thank you.
SetOption("InitialEquity", 100000 );
SetPositionSize(100,spsPercentOfEquity);
//BUY CONDITION
c1= RSI(5) < 30;
c2= Close > MA(Close,200);
//SELL CONDITION
s1= RSI(5) >70;
Buy= c1 AND c2;
Sell= s1;
{
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-15);
}
{
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Plot( C, "Price", IIf( C > O, colorBrightGreen,colorRed ), styleCandle|styleNoTitle|styleNoLabel );
Ybuyprice = ValueWhen( Buy, Close);
Intrade= Flip(Buy,Sell);
Ybuyprice=IIf(intrade,ybuyprice,Null);
Plot(Ybuyprice,"BP",colorGreen,styleLine,Null,Null,0,0,3);
p1= Ybuyprice-20;
p1line=IIf(intrade,p1,Null);
Plot(p1line,"p1",colorAqua,styleline,Null,Null,0,0,3);
p2= Ybuyprice-40;
p1line=IIf(intrade,p2,Null);
Plot(p1line,"p2",colorAqua,styleline,Null,Null,0,0,3);
p3= Ybuyprice-60;
p1line=IIf(intrade,p3,Null);
Plot(p1line,"p3",colorAqua,styleline,Null,Null,0,0,3);
DoScaleIncon = ExRem(InTrade AND close < p1, Sell) OR ExRem(InTrade AND close < p2, Sell) OR ExRem(InTrade AND close < p3, Sell);
PlotShapes(IIf(DoScaleIncon, shapeCircle, shapeNone),colorBlue, 0,L, Offset=-40);
Buy = Buy + sigScaleIn *DoScaleIncon;
}
Title = StrFormat("{{NAME}} - {{INTERVAL}} - {{DATE}}" +
EncodeColor(colorRed)+
"\n APERTURA = "+Open+" MAXIMO = "+High+" MINIMO = "+Low+" CIERRE = "+Close+ " VARIACION DIARIA = "+Prec( ROC( C, 1 ), 2) +"%%")+
StrFormat("\nBP", Ybuyprice)+" = "+Prec(Ybuyprice, 2)+
StrFormat("\nP1",P1)+" = "+Prec(P1, 2)+
StrFormat("\nP2", P2)+" = "+Prec(P2, 2)+
StrFormat("\nP3", P3)+" = "+Prec(P3, 2);
Short = 0;
Cover = 0;