Luandre Ezra:
Hi,
I have 3 input variables with enum data type and 3 other variables with double data type.
if I want to use fixed stoploss on InpCloseTradeBy variable I will use InpCoef variable for the input value that I need, so does with InpCloseTradeBy2 with InpCoef2 and InpCloseTradeBy3 with InpCoef3. The problem is that I can use (e.g) Fixed stoploss in one of the close trade by variable.
When I want to open new position, on MqlTradeRequest SL parameter I use this code,
Is there a simpler way to tell the EA if fixed stoploss is on InpCloseTradeBy2 variable, it should use data from InpCoef2 variable?
You could create a new variable on global space (call it iE sl_coef) and assign the value to be used from input to it.
Also, you could use a switch() statement instead of an if() statement.
This way you have only one variable to use when calculating/setting your SL
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 have 3 input variables with enum data type and 3 other variables with double data type.
if I want to use fixed stoploss on InpCloseTradeBy variable I will use InpCoef variable for the input value that I need, so does with InpCloseTradeBy2 with InpCoef2 and InpCloseTradeBy3 with InpCoef3. The problem is that I can use (e.g) Fixed stoploss in one of the close trade by variable.
When I want to open new position, on MqlTradeRequest SL parameter I use this code,
Is there a simpler way to tell the EA if fixed stoploss is on InpCloseTradeBy2 variable, it should use data from InpCoef2 variable?