Dislikedhello... everyone help to code this....and developed this stg thank you{image}Ignored
i have exactly what you're looking for. I have this many years ago.
You have to considered any other possible scenarios, it's not as simple as you explain. I have some variations of this kind of logic..
For Stop Order Level, you can use some indis (ATR, NRTR, S&R, etc) or even MA or you can set fixed pip range..
In price move UPs or DOWNs, you can trail those level or not, automatic or manual..
For Buy Pending orders (Stop / limit), you must consider floating spread. Sometimes, spread is too wide..
Or say your SellStop is triggered & spread widen over 10pips & your Sell SL get hit..
Widening spread will affect on Long Pending Price and Short SL..
I have completed all possibilities scenario i could think of just for this logic..
When to use market order, stop order or limit order...
I'll give some explanations later with pictures