Profit = 10; // профит в валюте
if(CountTrades()<1 && Bid>pr-bp && Bid<pr+bp)
if(CountTrades()<1 && Bid>pr-10*_Point && Bid<pr+10*_Point)
if(CountTrades()<1 && Bid>pr-30*_Point && Bid<pr+30*_Point)
<code> //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { double blu = iCustom(NULL,0,IndName,Fast,Slow,Price,0,1); double red = iCustom(NULL,0,IndName,Fast,Slow,Price,1,1); double blu1 = iCustom(NULL,0,IndName,Fast,Slow,Price,0,2); double red1 = iCustom(NULL,0,IndName,Fast,Slow,Price,1,2); //-------------------------------------------------------- double blu2 = iCustom(NULL,0,IndName,Fast2,Slow2,Price2,0,1); double red2 = iCustom(NULL,0,IndName,Fast2,Slow2,Price2,1,1); double blu3 = iCustom(NULL,0,IndName,Fast2,Slow2,Price2,0,2); double red3 = iCustom(NULL,0,IndName,Fast2,Slow2,Price2,1,22); //----------------------------------------------------------- bool buy = blu!=EMPTY_VALUE && blu2!=EMPTY_VALUE && (blu1==EMPTY_VALUE || blu3==EMPTY_VALUE); bool sell = red!=EMPTY_VALUE && red2!=EMPTY_VALUE && (red1==EMPTY_VALUE || red3==EMPTY_VALUE); if(t!=Time[0]) { if(AllProfit()>=Profit && Profit>0) CloseAll(); if(AllProfit(0)>=BuyProfit && BuyProfit>0) CloseAll(0); if(AllProfit(1)>=SellProfit && SellProfit>0) CloseAll(1); if(CloseSig>0) { if(buy) { CloseAll(1); } if(sell) { CloseAll(0); } } if(Hour()>=StartHour && Hour()<=EndHour && CountTrades()<Count) { if(buy) { PutOrder(0,Ask); } if(sell) { PutOrder(1,Bid); } } t=Time[0]; } Comment("\n Trades: ",CountTrades(), "\n Profit : ",AllProfit(), "\n Buy Profit : ",AllProfit(0), "\n Sell Profit : ",AllProfit(1), "\n Blu: ",blu, "\n Red: ",red, "\n Blu2: ",blu2, "\n Red2: ",red2); } </code>
создавайте новое детальное ТЗ со скринами и оформляйте в новом топике.
verta81