I want to write a strategy for a stop loss modification.
I wrote it however it doesn't work properly. It works but has different results.
You may look it on example:
Lets say my stop loss is 4 ticks
If I have:
+5 ticks profit modify stop loss to -3 ticks loss
+6 ticks profit modify stop loss to -2 ticks loss
+7 ticks profit modify stop loss to -1 tick loss
+8 ticks profit modify stop loss to 0 tick break-even
+9 ticks profit modify stop loss to +1 tick profit
+10 ticks profit modify stop loss to +2 tick profit
+11 ticks profit modify stop loss to +3 tick profit
if (Position.MarketPosition == MarketPosition.Short)
{
if(Low[0] <= Position.AvgPrice - (5 * TickSize))
SetStopLoss("Short1",CalculationMode.Price, Position.AvgPrice + (3*TickSize) ,false);
...
if(Low[0] == Position.AvgPrice - (11 * TickSize))
SetStopLoss("Short1",CalculationMode.Price, Position.AvgPrice - (3*TickSize),false);
}
It check only the last bar low[0] to last entry price.
If I leave only ONE stop loss modification it works great.
+8 ticks profit modify stop loss to 0 tick break-even
It does exactly what I want.
It finds THE LOWEST LOW from my ENTRY PRICE and compared to current price.
However when I use all of them it is a mess.
If you know how to help me to modify stop losses to different parameters I will only appreciate
Script included
Thanks,
Serge
Comment