[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Help with coding



PureBytes Links

Trading Reference Links

Hi
I am currently facing two problems which I wonder If some one could
help me with?:

1) Trying to code a 2 day breakout system. I want to plot the max 2
days high and the minimum 2 days low. The lines should only be updated
every 2 days and return and plot the upper boundery for that 2 day
period. It should not plot and update it every day as I am getting
now. (I want a similar line for the previous two days). 
This is what I got so far:

////////////////
L1= TimeFrameGetPrice("L", inDaily,-1);
L2= TimeFrameGetPrice("L", inDaily,-2);
H1= TimeFrameGetPrice("H", inDaily,-1);
h2= TimeFrameGetPrice("H", inDaily,-2);

Upper= Ref(HHV(H1,2),-2);
Lower= Ref(LLV(L1,2),-2);

Plot( Upper, "U-2", colorGreen, styleLine, styleThick );
Plot( Lower, "L-2", colorRed, styleLine, styleThick );
//////////////////////



2)Trying to code a first hour breakout system. I want TH to return the
highest close for the first hour every day. I want TL to return the
lowest close for the first hour every day.
I cant get it to work which is very annoying.
This is what I got so far.

/////////////////////////////////
TH=IIf(103000<TimeNum()>093000,HHV(H,-60),0);
TL=IIf(103000<TimeNum()>093000,LLV(L,-60),0);
cond03= Cross( Closed, TH );
Buy =  Cond03 
/////////////////////////////


The above problems are probably very easy for elit programers, however
I am not one of them. Thanks in advanced!!!
//marcus