Every day control Chart width of a trading day

#1
AFL Program to calculate also the opening day of the first bars begin to close today。

After the opening of a Bar on the far left,Close to today。
AMI How to write?

BeginDay = Day() !=Day()Ref(Day(),-1);

BarsSine =(BeginDay);

TimeFrameSet(1*in1minute);

_H1 = H*0.22;
_L1 = L*0.33;
....
....
TimeFrameRestore();

plot1..._H1;
Plot2..._L1;

Please help to correct

Kreangast
2013/6/10
 
#2
K = Optimize("K", 0.72, 0.1, 4, 0.01);

LastDayH = TimeFrameGetPrice( "H",1*in1minute, -1);
LastDayC = TimeFrameGetPrice( "C", 1*in1minute, -1);
LastDayL = TimeFrameGetPrice( "L", 1*in1minute, -1);
ThisDayO = TimeFrameGetPrice( "O", 1*in1minute, 0);

Range = Max(LastDayH - LastDayC, LastDayC - LastDayL);
UpperBand = ThisDayO + K * Range;
LowerBand = ThisDayO - K * Range;

CoverPrice = BuyPrice = H + TickSize;
Cover = Buy = H > UpperBand;
SellPrice = ShortPrice = L - TickSize;
Sell = Short = L < LowerBand;
 

Similar threads