This is a great system, I found this that seems easier tell me if it makes sense to you
https://fxdreema.com/shared/GOHeJlHAc
TPB is a constant so it can be modified for each currency pair. It just checks when the trades get over breakeven and if the flag is true, which is only after a trade was opened it draws a horizontal line at the preferred distance.
Trades are closed when price passes the line.
This is done but sadly I had another problem...
If the server is restarted all of my martingale risk management screws up because I use this system:
https://fxdreema.com/shared/iQQPen5Zc
When the server restarts it's a mess and the lots multiply like crazy and make an insane profit or otherwise blow up because the trade size is too big.
Do you have any ideas to multiply volume size from the last opened trade only, or otherwise draw on chart the last trades size so if the server restarts the robot can find it on the chart?