beyo45:
i want my EA to give different stoploss value to different currency pair based on the spread.
if spread <5 stoploss = 20
if spread > =5 <=10 stoploss =30
and
if spread >10 stoploss=35
pls help me with this simple code i have tried different means but it keep giving every trade the same stoploss irrespective of the spread/.
i want my EA to give different stoploss value to different currency pair based on the spread.
if spread <5 stoploss = 20
if spread > =5 <=10 stoploss =30
and
if spread >10 stoploss=35
pls help me with this simple code i have tried different means but it keep giving every trade the same stoploss irrespective of the spread/.
Write me mikemb@ittportal.net
What is a problem?
for (i=0;i<OrdersTotal();i++) { if (!OrderSelect()) continue; spread=MarketInfo(OrderSymbol(),MODE_SPREAD); if (spread <5) stoploss = 20; if (spread > =5 && spread<=10) stoploss =30; if (spread >10) stoploss=35; // setup Stop Loss and any other operations }
thank you rosch.i am just missing out the for statement.it's perfect.please kindly
help me have a look at my recent question.thanks a million!
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
if spread <5 stoploss = 20
if spread > =5 <=10 stoploss =30
and
if spread >10 stoploss=35
pls help me with this simple code i have tried different means but it keep giving every trade the same stoploss irrespective of the spread/.