/*[[ Name := BronzeWarrioir01-std Author := Copyright © 2005, HomeSoft Corp, modified by treberk. Link := spiky@sinet.spb.ru Lots := 0.1 Stop Loss := 1000 Take Profit := 60 Trailing Stop := 0 ]]*/ Defines : mm(1),test(1),pred(100),FrMarg(2000),porog(500),per(14),d(3); Vars: ft(true),mlot(0),j(0),s(0),b(0),pr(4),summa(0),sell(0),blok(0),imp(0),ssum(0),iMax(0),iMin(1000),works(0),workb(0); Vars : cnt(0),Top(0),inul(0),ione(0),pm(0),down(0),bloks(0),blokb(0),ps(0),wpr(0),cci(0),buy(0),bsum(0),mblok(0); //---------------------------------------------------------------------------------------------------------------------// // При изменении хеджирующего лота путём изменения параметра mm величину порога отсечки профита надо также изменить // // пропорционально. Например при величине mm=50 величина хеджирующего лота равна 5.0, а при лоте 1.0 она должна быть // // изменена на 10, а порог отсечки профита должен быть в диапазоне 150-100. Таким образом мы устраняем провалы профита.// // Все остальные параметры можно варьировать в разумных пределах, свойственных тому или иному индикатору при работе. // //---------------------------------------------------------------------------------------------------------------------// // Например для пары GBPUSD на ТФ=М15 подобраны следующие параметры: porog=600;works=50;workb=-50;sliv=-2000;mm=30; // // pred=100;wpr=(-15 & -85);cci(-150 & +150); Изменение параметра mm для увеличения доходности повлечёт изменение и др.// //---------------------------------------------------------------------------------------------------------------------// j=j+1; if j>=1000 then j=0; if ft then Begin if point>0.002 then pr=2;ft=false;end; if b+s==0 then pm=0; b=0;s=0;summa=0;ssum=0;bsum=0; for cnt=1 to TotalTrades Begin if OrderValue(cnt,VAL_SYMBOL)=Symbol then Begin if OrderValue(cnt,VAL_TYPE)=OP_SELL then Begin ssum=ssum+OrderValue(cnt,VAL_PROFIT);s=s+1;end; if OrderValue(cnt,VAL_TYPE)=OP_BUY then Begin bsum=bsum+OrderValue(cnt,VAL_PROFIT);b=b+1;end;end;end; summa=ssum+bsum; if summa<0 and s+b!=0 and down>summa then down=(round(summa)); if s+b=0 then blok=0; if s+b=0 and down<-3000 then down=0; if test=1 then Begin Print("Data: ",year,".",month,".",day," Time ",hour,":",minute," Pozz=",s+b," Impuls=",round(inul), " Blok=",blok," mBlok=",mblok," Bls=",bloks," Blb=",blokb," Price=",O[0]," Prof=",round(summa), " Down=",abs(down)," Swork=",works," Bwork=",workb);if j<=2 then Comment(" ");end; If CurTime-LastTradeTime<15 then exit; if b+s>0 and blok=0 then Begin if bsum<-2000 then Begin mlot=0.3; Setorder(OP_SELL,mm*mlot,PriceBid,3,Bid+StopLoss*point,Bid-TakeProfit*point,Gold);blok=1;exit;end; if ssum<-2000 then Begin mlot=0.3; Setorder(OP_BUY,mm*mlot,PriceAsk,3,Ask-StopLoss*point,Ask+TakeProfit*point,Gold);blok=1;exit;end;end; if s+b==0 and Balance=FreeMargin and Balance<5000 then Begin Comment(" ДЛЯ НОРМАЛЬНОЙ РАБОТЫ УВЕЛИЧЬТЕ ВАШ ДЕПОЗИТ ДО МИНИМАЛЬНОГО РАЗМЕРА В 20000$ ПРИ ЛОТЕ 1.0");exit;end; mlot=lots; inul=iCustom("DayImpuls",per,d,MODE_FIRST,0); ione=iCustom("DayImpuls",per,d,MODE_FIRST,1); if Minute=0 or iMin=1000 then Begin for cnt=96 downto 1 Begin imp=iCustom("DayImpuls",per,d,MODE_FIRST,cnt); if imp>iMax then iMax=imp; if impiMax then works=30 else works=60; if abs(iMin)=IMax then begin works=50;workb=-50;end;end; wpr=iWPR(per,0);cci=iCCI(per,0); if test=0 then Begin Comment("Data: ",year,".",month,".",day," Time ",hour,":",minute,"\n","Pozz=",s+b," Impuls=",round(inul)," Sb=",bloks, " Bb=",blokb," Blok=",blok," mBlok=",mblok," Price=",O[0]," Prof=",round(summa)," Down=",abs(down));end; if summa>=porog then pm=1; if pm==1 then Begin for cnt=1 to TotalTrades Begin if (OrderValue(cnt,VAL_TYPE)=OP_SELL and OrderValue(cnt,VAL_SYMBOL)=Symbol) then Begin CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Ask,5,Red);exit;end; if (OrderValue(cnt,VAL_TYPE)=OP_BUY and OrderValue(cnt,VAL_SYMBOL)=Symbol) then Begin CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Bid,5,Red);exit;end;end; end; if s+b==0 then Begin bloks=0;blokb=0;mblok=0;end; if FreeMargin>=FrMarg and s+b<2 then Begin if bloks=0 then Begin if inul>works and ione>=inul and wpr>-20 and cci>150 and s==0 then Begin blokb=1; //CCI>150;WPR(-15 & -85)-GBP Setorder(OP_SELL,mlot,PriceBid,3,Bid+StopLoss*point,Bid-TakeProfit*point,Gold);exit;end; if s=1 and b=0 and summa>30 and mblok=0 then Begin Setorder(OP_SELL,mm*mlot,PriceBid,3,Bid+StopLoss*point,Bid-((TakeProfit*point)/3),Gold);mblok=1;exit;end; if b==0 and s=1 and summa<-pred/2 and mblok=0 then Begin Setorder(OP_BUY,mm*mlot,PriceAsk,3,Ask-StopLoss*point,Ask+TakeProfit*point,Gold);mblok=1;exit;end;end; if blokb=0 then Begin if inul150;WPR(-15 & -85)-GBP Setorder(OP_BUY,mlot,PriceAsk,3,Ask-StopLoss*point,Ask+TakeProfit*point,Gold);exit;end; if b=1 and s=0 and summa>30 and mblok=0 then Begin Setorder(OP_BUY,mm*mlot,PriceAsk,3,Ask-StopLoss*point,Ask+((TakeProfit*point)/3),Gold);mblok=1;exit;end; if s==0 and b=1 and summa<-pred/2 and mblok=0 then Begin Setorder(OP_SELL,mm*mlot,PriceBid,3,Bid+StopLoss*point,Bid-TakeProfit*point,Gold);mblok=1;exit;end;end; end;