Simple Coding Help - No Promise.

amitrandive

Well-Known Member
I need a help.

I want to plot yesterdays close(daily) and todays(daily) open horizontal lines on my intraday charts..

just those two.. earlier lines I don't want.

I tried.. "indaily / timeframe expand/compress / timeframe set" etc

but somehow its not working.

can some one make this afl ( just for those two line.. no price chart needed) so I can drag and remove whenever I want.

I am using amibroker 5.40
thanks in advance.
Try this

Code:
TimeFrameSet(inDaily);
q=Ref(C,-1);
to=Ref(O,0);
TimeFrameRestore();
Plot(TimeFrameExpand(q,inDaily,expandFirst),"Previous day close",colorGreen,styleDots);
Plot(TimeFrameExpand(to,inDaily,expandFirst),"Today open",colorRed,styleDots);
 
Amit bro

i need not normal gap AFL , i need to find gap in consecutive 2/3 bars where the gap is not visible ..............let me show you


image hosting no registration

suppose these bars are chart bars /candles , then gap between 2 or 3 consecutive candles , i need AFL for this
Not a GAP in real sense hence the Indicator will also not see it as a Gap. The gap you have marked with red lines are not in consecutive days!!! In consecutive days prices are overlapping !
OR
I have totally misunderstood what you are looking for! :p
 
Amit bro

i need not normal gap AFL , i need to find gap in consecutive 2/3 bars where the gap is not visible ..............let me show you


image hosting no registration

suppose these bars are chart bars /candles , then gap between 2 or 3 consecutive candles , i need AFL for this
Plot( C, "Close", ParamColor("Candle Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

upbargap=Ref(C,-2)> Ref(O,-2) AND Ref(C,-1)> Ref(O,-1) AND Ref(C,0)> Ref(O,0) AND Ref(L,0)> Ref(H,-2) ;
downbargap=Ref(C,-2)< Ref(O,-2) AND Ref(C,-1)< Ref(O,-1) AND Ref(C,0)< Ref(O,0) AND Ref(H,0)< Ref(L,-2) ;

PlotShapes(shapeuparrow*upbargap,colorGreen,0,L);
PlotShapes(shapedownarrow*downbargap,colorRed,0,H);
Is it ok ?

consider the signal when current candle closes.
 
any coder willing to help??? situation is expllained in the chart.if folllowing cond occurs i dont want any signal in my chart.i dont know how to use " if " condition in buy sell signals.

AroonUp()<Ref(AroonUp(),-1) AND AroonDn()<Ref(AroonDn(),-1)

this situation is explained in the chart.



thanx in advance:)
uparrow= (your condition) AND AroonUp()>Ref(AroonUp(),-1) AND AroonDn()>Ref(AroonDn(),-1);
downarrow= (your condition) AND AroonUp()<Ref(AroonUp(),-1) AND AroonDn()<Ref(AroonDn(),-1);
If you can add this to your afl fine, else post the full code.
 
vijayanscbe bro its looking very good .

only 1 thing as i shown in chart there is gap in candle 1 and 2 low and high but AFL didnt mark this

Plot( C, "Close", ParamColor("Candle Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

upbargap= Ref(L,0)> Ref(H,-2) ;
downbargap= Ref(H,0)< Ref(L,-2) ;

PlotShapes(shapeuparrow*upbargap,colorGreen,0,L);
PlotShapes(shapedownarrow*downbargap,colorRed,0,H);
Now try this give feed back.
 

Similar threads