/*[[ Name := Robot_PowerM1_Scalper-MC Author := MT Link := http://www.metexinvest.com/ Notes := long if bulls+bears>0:::short if bulls+bears<0 Notes := multiple currencies Lots := 1.00 Stop Loss := 30 Take Profit := 50 Trailing Stop := 5 ]]*/ vars: bull(0),bear(0); bull= iBullsPower(5,PRICE_CLOSE,1); bear= iBearsPower(5,PRICE_CLOSE,1); define: slippage(2); Define: BullBearPeriod(5); vars: sl(0),tp(0); vars: cnt(0); vars: OpenTrades(0); vars: i(0); Define: ProfitMade(2); OpenTrades = 0; For i = 1 to TotalTrades { if OrderValue(i,VAL_SYMBOL) = Symbol then OpenTrades++; }; If OpenTrades<1 then { If bull+bear>0 then { sl=(ask-(StopLoss*point)); tp=(bid+(TakeProfit*point)); SetOrder(OP_BUY,Lots,ask,slippage,sl,tp,blue); exit; }; If bull+bear<0 then { sl=(bid+(StopLoss*point)); tp=(ask-(TakeProfit*point)); SetOrder(OP_SELL,Lots,bid,slippage,sl,tp,red); exit; }; }; If OpenTrades<1 then { if bull + bear > 0 then { sl=(ask-(StopLoss*point)); tp=(bid+(TakeProfit*point)); SetOrder(OP_BUY,Lots,ask,slippage,sl,tp,blue); exit; }; if bull + bear < 0 then { sl=(bid+(StopLoss*point)); tp=(ask-(TakeProfit*point)); SetOrder(OP_SELL,Lots,bid,slippage,sl,tp,red); exit; }; }; for cnt=1 to TotalTrades { If Ord(cnt,VAL_TYPE)=OP_BUY and Ord(cnt,VAL_SYMBOL)=Symbol then { If (Bid-Ord(cnt,VAL_OPENPRICE))>(ProfitMade*Point) then { CloseOrder(OrderValue(cnt,VAL_TICKET),Ord(cnt,VAL_LOTS),Ord(cnt,VAL_CLOSEPRICE),0,BlueViolet); Exit; }; }; If Ord(cnt,VAL_TYPE)=OP_SELL and Ord(cnt,VAL_SYMBOL)=Symbol then { If (Ord(cnt,VAL_OPENPRICE)-Ask)>(ProfitMade*Point) then { CloseOrder(OrderValue(cnt,VAL_TICKET),Ord(cnt,VAL_LOTS),Ord(cnt,VAL_CLOSEPRICE),0,Purple); Exit; }; }; };