#property copyright "RIP"
#property link ""
#property version "1.00"
#property strict
extern int Tenkan=9;
extern int Kijun=26;
extern int SenkouB=52;
extern int Magic=54545343;
extern double Lot=0.1;
extern int SL=50;
extern int TP=150;
int start()
{
int kolpos=0;
double TK=iIchimoku(Symbol(),0,Tenkan,Kijun,SenkouB,MODE_TENKANSEN,0);
double KJ=iIchimoku(Symbol(),0,Tenkan,Kijun,SenkouB,MODE_KIJUNSEN,0);
double SSA=iIchimoku(Symbol(),0,Tenkan,Kijun,SenkouB,MODE_SENKOUSPANA,0);
double SSB=iIchimoku(Symbol(),0,Tenkan,Kijun,SenkouB,MODE_SENKOUSPANB,0);
double CH=iIchimoku(Symbol(),0,Tenkan,Kijun,SenkouB,MODE_CHINKOUSPAN,0);
//-----
for(int pos=0; pos<OrdersTotal(); pos++)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==True) break;
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
kolpos++;
}
//Ордера только советника
if(kolpos==0)
{
if(SSA>SSB && Close[1]>SSA && Volume[0]<3)
OrderSend(Symbol(),OP_BUY,Lot,Ask,10,Ask-SL*Point,Ask+TP*Point,NULL,Magic,0,Green);
if(SSB>SSA && Close[1]>SSB && Volume[0]<3)
int buy=OrderSend(Symbol(),OP_BUY,Lot,Ask,10,Ask-SL*Point,Ask+TP*Point,NULL,Magic,0,Green);
if(SSA>SSB && Close[1]<SSA && Volume[0]<3)
int sell=OrderSend(Symbol(),OP_SELL,Lot,Bid,10,Bid+SL*Point,Bid-TP*Point,NULL,Magic,0,Red);
if(SSB<SSA && Close[1]<SSB && Volume[0]<3)
int sell=OrderSend(Symbol(),OP_SELL,Lot,Bid,10,Bid+SL*Point,Bid-TP*Point,NULL,Magic,0,Red);
}
return(0);
}