/*[[ Name := Set StopLoss And Or TakeProfit If None Author := Copyright © 2006 , David W Honeywell Link := transport.david@gmail.com Notes := created for fxgenius , fxgenius@yahoo.com Notes := post # 40609 at http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/ Stop Loss := 10 Take Profit := 25 ]]*/ //- Set StopLoss If None ----------------------------------------------------------------------------------- Variable: cnt(0); For cnt = 1 To TotalTrades { If (Ord(cnt,VAL_TYPE)==OP_BUY) Then { If ((Ord(cnt,VAL_STOPLOSS)==0) Or (Ord(cnt,VAL_TAKEPROFIT)==0)) Then { ModifyOrder(Ord(cnt,VAL_TICKET), Ord(cnt,VAL_OPENPRICE), ((Ord(cnt,VAL_OPENPRICE))-StopLoss*Point), ((Ord(cnt,VAL_OPENPRICE))+TakeProfit*Point), White); Print("Manual Buy StopLoss and TakeProfit has been set ",Symbol); Exit; }; }; }; For cnt = 1 To TotalTrades { If (Ord(cnt,VAL_TYPE)==OP_SELL) Then { If ((Ord(cnt,VAL_STOPLOSS)==0) Or (Ord(cnt,VAL_TAKEPROFIT)==0)) Then { ModifyOrder(Ord(cnt,VAL_TICKET), Ord(cnt,VAL_OPENPRICE), ((Ord(cnt,VAL_OPENPRICE))+StopLoss*Point), ((Ord(cnt,VAL_OPENPRICE))-TakeProfit*Point), DodgerBlue); Print("Manual Sell StopLoss and TakeProfit has been set ",Symbol); Exit; }; }; }; //- End ----------------------------------------------------------------------------------------------------