Closing open trade when amount in deposit currency equals previous closed profit value
-
How can an open trade be closed when the loss amount in deposit currency equals previous closed profit value ...
-
I made this: https://fxdreema.com/shared/nnCFpUM7d

I don't know what should happen when the trade is on loss, so I set SL. That first Buy trade that was more profitable closed at profit >= than the loss of the previous one.
-
@fxdreema said in Closing open trade when amount in deposit currency equals previous closed profit value:
happen when the trade is on loss, so I set SL. That first Buy trade that was more
Thanks, very good. Although need to get the current loss variable and then compute, that when LastTradeProfit equals current loss in value i.e +20 usd == -20 usd, then close trade. Meaning don't want to loose more than previous earned profit
-
But it's not a good idea to use == to compare prices and profits. Use >= or <= instead.