I have a frustrating problem/quesstion
I have a stretegy where im using stop loss based on MIN/MAX function.
Code:
if (BarsSinceEntry("Long1") == 0)
{
SetStopLoss("Long1", CalculationMode.Price,min, false);
DrawLine(min.ToString(), false, 2, min, 0, min, Color.Black, DashStyle.Dot, 2);
}
if (BarsSinceEntry("Short1") == 0)
{
DrawLine(max.ToString(), false, 2, max, 0, max, Color.Black, DashStyle.Dot, 2);
SetStopLoss("Short1", CalculationMode.Price,max, false);
}
variables min/max are defined:
min = MIN(Low,pocetBar)[1];
max = MAX(High,pocetBar)[1];
SL is working corectly bud still exist one bad situation , which is over my mind/programming skills.
If my position is open and then next bar is value of my stoploss targeted , position is not closed on SL value , bu is closed on open price of next bar.
Can somebody help me in my problem?
Thank you!!! In Attachment is a screenshot
dedomraz
Comment