|
МТС Черепахи
Для тех, кто знаком с программированием:
Торговая система Turtles
{Description: Original Turtles Trading System Provided By: Atlantis(c) Copyright 2001} variables: ATRVal(0),pastpos(0),incls(0),beflg(0),bgflg(0),pasprof(0),oldpos(0), ctr(1),by1(3),by2(2),by3(1);
condition1 = high > highest(high,55)[1]; condition2 = high > highest(high,20)[1]; condition3 = high > highest(high,10)[1]; condition4 = low < lowest(low,55)[1]; condition5 = low < lowest(low,20)[1]; condition6 = low < lowest(low,10)[1]; if currentcontracts <> 0 then pastpos = oldpos; if currentcontracts <> 0 then pasprof = openpositionprofit; if currentcontracts = 0 then pasprof = positionprofit(1); condition7 = pasprof < 1; if currentcontracts = 0 and pasprof < 1 and (condition2 or condition5) then begin if condition2 then begin buy ctr contracts at market; oldpos = 1; end; if condition5 then begin sell ctr contracts at market; oldpos = -1; end; beflg = 0; bgflg = 0; end; if currentcontracts = 0 and pasprof > 0 and (condition2 or condition5) then begin if pastpos = 1 then begin if condition2 then buy ctr contracts at market; oldpos = 1; end; if pastpos = -1 then begin if condition5 then sell ctr contract at market; oldpos = -1; end; beflg = 0; bgflg = 0; end; if condition1 or condition4 then begin if condition1 and oldpos <= 0 then begin buy ctr contracts at market; beflg = 0; bgflg = 0; oldpos = 1; end; if condition4 and oldpos >= 0 then begin sell ctr contracts at market; beflg = 0; bgflg = 0; oldpos = -1; end; end; if barssinceentry(0) = 1 then begin ATRVal = AvgTrueRange(10) * 2; incls = close; end; if barssinceentry(0) > 0 and openpositionprofit > (2.5*ATRVal *bigpointvalue*ctr) then begin beflg = 1; end; if barssinceentry(0) > 0 and openpositionprofit > (10*ATRVal *bigpointvalue*ctr) then begin bgflg = 1; end; if barssinceentry(0) > 0 then begin exitlong at incls - ATRVal stop; exitshort at incls + ATRVal stop; end; if beflg = 1 then begin exitlong at entryprice(0) stop; exitshort at entryprice(0) stop; end; if beflg = 1 then begin exitlong at lowest(low,20)[1] stop; exitshort at highest(high,20)[1] stop; end; if beflg = 0 then begin exitlong at lowest(low,10)[1] stop; exitshort at highest(high,10)[1] stop; end; if bgflg = 1 then begin exitlong at swinglow(1,low,3,barssinceentry(0)) stop; exitshort at swinghigh(1,high,3,barssinceentry(0)) stop; end;
МТС Черепахи |
Подразделов нет |
|