help with a problem with stoploss in my EA

 
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/.
 
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/.

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!
Reason: