Simple Coding Help - No Promise.

amitrandive

Well-Known Member
Joined
Jul 26, 2010
Messages
8,717
Likes
23,669
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);
 

umeshmandal

Well-Known Member
Joined
Sep 14, 2008
Messages
1,293
Likes
707
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
 

nifty trade

Well-Known Member
Joined
Aug 26, 2014
Messages
1,135
Likes
1,213
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!
Yes if seen as perspective of 1st and 3rd candle it's a gap, and I need afl to see and mark these gaps
 

vijayanscbe

Well-Known Member
Joined
Apr 10, 2008
Messages
322
Likes
528
Location
coimbatore
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.
 

vijayanscbe

Well-Known Member
Joined
Apr 10, 2008
Messages
322
Likes
528
Location
coimbatore
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

Well-Known Member
Joined
Apr 10, 2008
Messages
322
Likes
528
Location
coimbatore


vijayanscbe bro its looking very good .:thumb:

only 1 thing as i shown in chart there is gap in candle 1 and 2 low and high but AFL didnt mark this
I programmed like, if three continous bull/bear bar, ok no problem I alter it tomorrow
 

mastermind007

Well-Known Member
Joined
Dec 17, 2011
Messages
2,495
Likes
2,500

vijayanscbe

Well-Known Member
Joined
Apr 10, 2008
Messages
322
Likes
528
Location
coimbatore
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

Broker Special Offers