Luandre Ezra: if there's anything that can be optimize or corrected
Do not use strings or ints return("CHANGE BUY SL"); ⋮ return("CHANGE SELL SL"); else return("NO CHANGE IN SL"); ⋮ void ProcessTradeMangement(int SymbolLoop, string TradeManagementDirection) bool changeSL = false; if(TradeManagementDirection == "CHANGE BUY SL" && buyCount>0) changeSL = true;
when you mean an enumeration: enumeration ChangeSL{ CSL_BUY, CSL_SELL, CSL_IDLE}; ⋮ return(CSL_BUY); ⋮ void ProcessTradeMangement(int SymbolLoop, ChangeSL TradeManagementDirection) ⋮ if(TradeManagementDirection == CSL_BUY && buyCount>0)
Simplify bool changeSL = false; if(TradeManagementDirection == "CHANGE BUY SL" && buyCount>0) changeSL = true;
your booleans bool changeSL = TradeManagementDirection == "CHANGE BUY SL" && buyCount>0;
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I'd like to change my SL to breakeven when certain logic triggered.
I used code above to change SL to Breakeven when logic returns true. I'd like to ask if there's anything that can be optimize or corrected.
Thank you