/*[[ Name := MiniMax02-Eur-Jpy-M15-MiniLot Author := Copyright © 2004, MetaQuotes Software Corp. Link := http://www.metaquotes.net/ Lots := 0.1 Stop Loss := 60 Take Profit := 60 Trailing Stop := 0 ]]*/ Defines: depth(12),deviation(5),backstep(3),mgod(2005),per(14),kk(5); Vars: j(0),i(0),k(0),cnt(0),b(0),s(0),MaxH(0),MinL(0),m(0),ZZ(0),ZZO(0),kks(0),kkb(0),wpr(0),ssig(0); Vars: n(0),mdd(0),p(0),bloks(0),blokb(0),canal(0),dsl(0),dtp(0),porog(0),MHOld(0),MLOld(0),bsig(0); if mgod<>year then exit; k=k+1;if k=10000 then begin p=p+1;k=0;end;if k=1 and p=0 then mdd=0; //-----------------------------------------МиниМаксы&Индикаторы------------------------------------------------ if MaxH<>MHOld and MaxH<>H[per] then MHOld=MaxH;if MinL<>MLOld and MinL<>L[per] then MLOld=MinL; MaxH=H[per];MinL=L[per]; For m=per downto 0 begin if H[m]>MaxH then MaxH=H[m];if L[m]20 and canal<=40 then dsl=-30;if canal>40 and canal<=60 then dsl=-20; if canal>60 then dsl=-10;if canal<=20 then dtp=44;if canal>20 and canal<=40 then dtp=40; if canal>40 and canal<=60 then dtp=35;if canal>60 then dtp=30; if lots=0.1 then begin if canal>=20 then porog=(TakeProfit*2)/10 else porog=5;end; if lots=0.5 then begin if canal>=20 then porog=(TakeProfit*2)/5 else porog=20;end; if lots=1.0 then begin if canal>=20 then porog=TakeProfit*2 else porog=50;end; if TotalTrades=0 then begin b=0;s=0;end; if ZZ<>0 and ZZ<>ZZO then ZZO=ZZ; ZZ=iCustom("Zigzag",depth,deviation,backstep,MODE_FIRST,0); if ZZ<>0 and ZZ<>ZZO and abs(ZZ-ZZO)>=30*point then begin if (MaxH-MinL)/point>30 then SetArrow(Time[0],ZZ,159,Gold);end; wpr=iWPR(per,0);if b+s=0 then begin blokb=0;bloks=0;end; //--------------------------------------------Подсчёт открытых позиций--------------------------------------- if TotalTrades>0 then begin b=0;s=0; for cnt=1 to TotalTrades begin if (OrderValue(cnt,VAL_TYPE)=OP_SELL and OrderValue(cnt,VAL_SYMBOL)=Symbol) then s=s+1; if (OrderValue(cnt,VAL_TYPE)=OP_BUY and OrderValue(cnt,VAL_SYMBOL)=Symbol) then b=b+1;end;end; Comment("Data: ",year,".",month,".",day," Time ",hour,":",minute," MaxH=",MaxH," MinL=",MinL," ZZ=",ZZ," Canal=",canal," Pozz=",b+s, "\n","OtPro=",porog," BSi=",bsig," SSi=",ssig," BB=",blokb," BS=",bloks," KKS=",kks," KKB=",kkb," Korr=",kk," WPR=",round(wpr)," KInd=",k); //---------------------------------------------Снятие сливок---------------------------------------------- Print("Data: ",year,".",month,".",day," Time ",hour,":",minute," MaxH=",MaxH," MinL=",MinL," Canal=",canal, " OtPro=",porog," BSi=",bsig," SSi=",ssig," SL=",StopLoss+dsl," TP=",TakeProfit-dtp," WPR=",round(wpr)," Profit=",round(TotalProfit)); if TotalTrades>0 then begin If CurTime-LastTradeTime<11 then exit; for cnt=1 to TotalTrades begin if (OrderValue(cnt,VAL_TYPE)=OP_SELL and OrderValue(cnt,VAL_SYMBOL)=Symbol) then begin if OrderValue(cnt,VAL_PROFIT)>porog then begin CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Bid,5,Red);s=s-1;exit;end;end; if (OrderValue(cnt,VAL_TYPE)=OP_BUY and OrderValue(cnt,VAL_SYMBOL)=Symbol) then begin if OrderValue(cnt,VAL_PROFIT)>porog then begin CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Ask,5,Red);b=b-1;exit;end;end;end;end; //-------------------------------------------------Open Positions--------------------------------------------- if b+s=0 then begin ssig=0;bsig=0; If bloks=0 and s=0 and ZZ<>0 and ((abs(ZZ-H)/point)<=2) and ((abs(MaxH-H)/point)<=2) and wpr>-20 then begin ssig=1;kks=kks+1; If CurTime-LastTradeTime<11 or kks0 and ((abs(ZZ-L)/point)<=2) and ((abs(MinL-L)/point)<=2) and wpr<-80 then begin bsig=1;kkb=kkb+1; If CurTime-LastTradeTime<11 or kkb