Автор:
Разместил:   Дата: 2005-12-27 16:47
Комментарии: (0)   Рейтинг:

DBS 9.2 (a)

Typ : Signal

Inputs: Ceil(60), Flr(20);

Var: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0), Pos(0),
OpLoss(0), OpPro(0), BottDay(0), PeakDay(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar =1 then
  VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

Buy ("Go Long") tomorrow at Highest(High, VarA) Stop;
Sell ("Go Short") tomorrow at Lowest(Low, VarA) Stop;
ExitLong ("Exit Long") tomorrow at Lowest(Low, VarB) Stop;
ExitShort ("Exit Short") tomorrow at Highest(High, VarB) Stop;

Pos = MarketPosition;
OpLoss = MaxPositionLoss;
OpPro = MaxPositionProfit;

If OpLoss < OpLoss[1] And Pos <> 0 Then
   BottDay = BarsSinceEntry(0);

If OpPro > OpPro[1] And Pos <> 0 Then
   PeakDay = BarsSinceEntry(0);

If CurrentBar = 1 Then
   Print(File("c:UaSystemsExam.txt"),"EntryDate",",","EntryPrice",",",
   "MarketPosition",",","MaxPositionLoss",",","BottomDay",",",
   "MaxPositionProfit",",","PeakDay",",","PositionProfit",",","LengthOfTrade");

If Pos <> Pos[1] And Pos[1] <> 0 Then
   Print(File("c:UaSystemsExam.txt"),EntryDate(1),",",EntryPrice(1),","
   ,MarketPosition(1),",",
   (MaxPositionLoss(1)/BigPointValue)*100/EntryPrice(1),",",BottDay,",",
   (MaxPositionProfit(1)/BigPointValue)*100/EntryPrice(1),",",PeakDay,",",
   (PositionProfit(1)/BigPointValue)*100/EntryPrice(1),",",BarsSinceEntry(1));





 
Реклама:

Rambler's Top100

Страница создана за 0.032 секунды