داخل الدالة start
نعرف متغيرين
[PHP]double SL,TP;[/PHP]
ثم داخل اقواس الشرط نضع
[PHP]if(StopLoss==0){SL=0;}else{SL=Ask-StopLoss*point;}[/PHP]
[PHP]if(TakeProfit==0){TP=0;}else{TP=Ask+TakeProfit*poi nt;}[/PHP]
بالنسبة لعملية buy
و نضع داخل اقواس الشرط الثاني
[PHP]if(StopLoss==0){SL=0;}else{SL=Bid+StopLoss*point;}[/PHP]
[PHP]if(TakeProfit==0){TP=0;}else{TP=Bid-TakeProfit*point;}[/PHP]