Hi,
I'm currently struggling with an issue I have no idea yet, how to solve.
Let's assume I calculate the ATR value and use a multiplier of it either for SL and TP. As an example let's assume ATR is 10 and TP multilpier is 4, which means TP is 40 pips away from open price.
After a while my trade goes in profit and I want to partly close a defined number of pips (eg. 25% of my TP or in that example 1 initial ATR distance from opening).
Possible solution 1:
Get to know how many candles trade is open and recalclate ATR from opening candle, store it in a variable and check if openingPrice + initialATR > than current bit/ask price depending on trade direction.
Possible solution 2:
Get the distance between openingPrice and currentTP and divide it by the number (here 4) and check if current ask/bitPrice +/- tpDistance divided by tpMultiplier is > 0
There may be other solutions, such as storing the TP per trade (ordernumber) as a global variable, which may survive a terminal restart. But I have no idea how to do so with fxdreema.
I could also open 2 trades and give them a splited lot size with 2 different TPs, but I don't like that approach so much.
Any ideas or tips I'd really appreciate!