Simple Coding Help - No Promise.

TradeOptions

Well-Known Member
Sorry for asking for it I found out this AFL on internet

However,.......I am still searching for this AFL-

AFL for identifying stocks with GAP not yet Filled,

Thanx
--------------------------------------------------------------------------

See if this help in finding the gaps -

Code:
_SECTION_BEGIN("Background Color");
BKswitch = ParamToggle("Background Color","On,Off");

OUTcolor = ParamColor("Outer Panel Color",colorLightBlue);
INUPcolor = ParamColor("Inner Panel Upper",colorBlack);
INDNcolor = ParamColor("Inner Panel Lower",colorBlack);
TitleColor = ParamColor("Title Color ",ColorRGB(245,245,245));

if (NOT BKswitch)
{
SetChartBkColor(OUTcolor); // color of outer border
SetChartBkGradientFill(INUPcolor,INDNcolor,TitleColor); // color of inner panel
}
_SECTION_END();



Gup = L>Ref(H,-1);  
Gdn = H<Ref(L,-1);  
Gap = Gup OR Gdn;  
LinLen = Param("Gap Line length",10,1,100,1);  
ShowLine = BarsSince(Gup OR Gdn) < LinLen;  
TextPos = Showline < Ref(ShowLine,-1);  
GapUpHi = IIf( ShowLine, ValueWhen(Gup,Ref(H,-1)),Null);  
GapUpLo = IIf( ShowLine, ValueWhen(Gup,L), Null); // OK  
GapDnHi = IIf( ShowLine, ValueWhen(GDn,Ref(L,-1)), Null); // OK  
GapDnLo = IIf( ShowLine, ValueWhen(GDn,H), Null);  
GapLineHi = IIf( ShowLine, ValueWhen(Gap,IIf( Gup, L, IIf( GDn, Ref(L,-1), Null))), Null);  
GapLineLo = IIf( ShowLine, ValueWhen(Gap,IIf( Gdn, H, IIf( Gup, Ref(H,-1), Null))), Null);  
Plot(C,"",colorWhite,styleCandle);  
Plot(GapLineHi,"",5,styleStaircase);  
Plot(GapLineLo,"",4,styleStaircase);  
FirstVisibleBar = Status( "FirstVisibleBar" );  
Lastvisiblebar = Status("LastVisibleBar");  
for( b = Max(LinLen,Firstvisiblebar); b <= Lastvisiblebar AND b < BarCount; b++)  
{  
if( Gap[b-LinLen+1] )  
{  
PlotText(NumToStr(GapLineHi[b],1.2),b,GapLineHi[b],5);  
PlotText("\n"+NumToStr(GapLineLo[b],1.2),b,GapLineLo[b],4);  
}  
}
Regards :)
 

amitrandive

Well-Known Member
Sorry for asking for it I found out this AFL on internet

However,.......I am still searching for this AFL-

AFL for identifying stocks with GAP not yet Filled,

Thanx
---------------------------------------------------------------------------------------------------------------------------
SetChartOptions(0,chartShowDates);
SetChartBkColor(16);
GraphXSpace=Param("GraphXSpace",10,-100,100,1);
SetBarFillColor(IIf(O>C,24,19));
Plot(C,"Price",IIf(O>C,32,34),64);
dtn=DateNum();
haC=EMA((O+H+L+C)/4,3); haO=AMA(Ref(haC,-1),0.5);
haH=Max(H,Max(haC,haO)); haL=Min(L,Min(haC,haO));
_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
pxh= Status("pxHeight"); pxw=Status("pxWidth");
GfxSelectFont("Tahoma",pxh/8);
.
.
.

}
_SECTION_END();
---------------------------------------------------------------------------------------
Please use Code (#)tags for pasting code.

Gap Finder

http://www.wis estockt rader.com/indicators/1181-gap-finder(remove spaces)
 
See if this help in finding the gaps -

Code:
_SECTION_BEGIN("Background Color");
BKswitch = ParamToggle("Background Color","On,Off");

OUTcolor = ParamColor("Outer Panel Color",colorLightBlue);
INUPcolor = ParamColor("Inner Panel Upper",colorBlack);
INDNcolor = ParamColor("Inner Panel Lower",colorBlack);
TitleColor = ParamColor("Title Color ",ColorRGB(245,245,245));

if (NOT BKswitch)
{
SetChartBkColor(OUTcolor); // color of outer border
SetChartBkGradientFill(INUPcolor,INDNcolor,TitleColor); // color of inner panel
}
_SECTION_END();



Gup = L>Ref(H,-1);  
Gdn = H<Ref(L,-1);  
Gap = Gup OR Gdn;  
LinLen = Param("Gap Line length",10,1,100,1);  
ShowLine = BarsSince(Gup OR Gdn) < LinLen;  
TextPos = Showline < Ref(ShowLine,-1);  
GapUpHi = IIf( ShowLine, ValueWhen(Gup,Ref(H,-1)),Null);  
GapUpLo = IIf( ShowLine, ValueWhen(Gup,L), Null); // OK  
GapDnHi = IIf( ShowLine, ValueWhen(GDn,Ref(L,-1)), Null); // OK  
GapDnLo = IIf( ShowLine, ValueWhen(GDn,H), Null);  
GapLineHi = IIf( ShowLine, ValueWhen(Gap,IIf( Gup, L, IIf( GDn, Ref(L,-1), Null))), Null);  
GapLineLo = IIf( ShowLine, ValueWhen(Gap,IIf( Gdn, H, IIf( Gup, Ref(H,-1), Null))), Null);  
Plot(C,"",colorWhite,styleCandle);  
Plot(GapLineHi,"",5,styleStaircase);  
Plot(GapLineLo,"",4,styleStaircase);  
FirstVisibleBar = Status( "FirstVisibleBar" );  
Lastvisiblebar = Status("LastVisibleBar");  
for( b = Max(LinLen,Firstvisiblebar); b <= Lastvisiblebar AND b < BarCount; b++)  
{  
if( Gap[b-LinLen+1] )  
{  
PlotText(NumToStr(GapLineHi[b],1.2),b,GapLineHi[b],5);  
PlotText("\n"+NumToStr(GapLineLo[b],1.2),b,GapLineLo[b],4);  
}  
}
Regards :)
Many Many Thanks Bro,

your AFL indeed helps me identify the GAPs in Price Chart.

However my requirement, ....... I know its very complicated .....

the Formula should look to the future ........draw a Horizontal Band towards Future Timeline and identify IF those GAPs were filled anytime afterwards .... or the GAP still Remains.

......Sorry for asking too much ...... but my requirement is bit complicated.

Thanx
 

amsin21

Well-Known Member
Re: Trades start and end with today's day validity

Dear timepass brother,

your answer not relevant to my request.. i never respond to your replies till your breath ends even if you use abuse language as before on others..
Hey,

Before pointing some allegation towards others you should have proofs. Can you please point out any posts of mine where abuse language is used? When ever I spoke to you through forum posts, I used the salutation "Bro", but you actually projected yourself out, what kind of person you are, using words like "timepass". I'm 48, how old are you son? Seems a long way to go, to get seasoned.

This spark started when I requested in your thread to post screenshots and description of AFL's to help TJ boarders including myself, but in return your answer was so arrogant. This attitude is not going to take you anywhere.

Any how best wishes.
 
Please use Code (#)tags for pasting code.

Gap Finder

http://www.wis estockt rader.com/indicators/1181-gap-finder(remove spaces)
Great Amit Bhai ......

This one exactly serves my requirement.

Thanx

Amit Bhai,

I am not able to do Scanning..... when I scan with this AFL .... Error Message displayed as Missing Buy/Sell Variable Assignments. ......... What does this mean ...... Any Fine-tuning / Modification in the formula is required.

Please advise.

Thanx a Ton.

Manoj

PS - Sorry ..... next time I will keep it in my mind to use Code (#)tags for pasting code.
 
Last edited:

josh1

Well-Known Member
Many Thanks Amit Bhai,

The links You mention gives AFL for Support / Resistance .... also TL Breakout.

I am new to Amibroker. Please guide me how I can modify / fine tune the AFL so that to include Buy / Sell Signal with Green / Red Coloured Arrow on Charts (instead of plotting of Trendlines) on TL BO or TL BD and also thereafter how the AFL can be modified to do Backtesting and Scanning.

Lots of Thanx once again.
Don't use it for Buy/Sell. You will loose money. Lines are not plotted until consecutive pivots are available. This AFL was discussed last year here - http://www.traderji.com/amibroker/88740-trendline-breakout-afl.html

Can anybody modify it to plot horizontal lines from Pivot points so that levels are visible? The lines should discontinue when they are cut by price. See red lines as given in below image

 
Last edited:

amsin21

Well-Known Member
Don't use it for Buy/Sell. You will loose money.

Can anybody modify it to plot horizontal lines from Pivot points so that levels are visible? The lines should discontinue when they are cut by price. See red lines as given in below image

Bro, too much lines on chart makes it less readable, isn't?

Posting my chart for suggestions (most welcome):

Yellow arrow = EMA crossover - EMAs hidden
Green line = EMA 55 periods
% lines = Fibonacci w/extensions
Dotted lines = Daily S/R lines
Red lines = Flag pattern S/R lines

 

josh1

Well-Known Member
Bro, too much lines on chart makes it less readable, isn't?
--- Yes..... It does.

But the idea is to replace the trend lines with horizontal lines indicating S/R.
Similarly, a line will discontinue as soon as it is cut by price. That will reduce number of lines on chart.

Read the Chart carefully. The area where Red lines are concentrated, indicated stiff S/R. Other area is empty.

 
Hello Josh

Search for the Support - Resistance AFL code by Edward Pottasch, you will get what you are looking for or maybe better :)

Happy :)



--- Yes..... It does.

But the idea is to replace the trend lines with horizontal lines indicating S/R.
Similarly, a line will discontinue as soon as it is cut by price. That will reduce number of lines on chart.

Read the Chart carefully. The area where Red lines are concentrated, indicated stiff S/R. Other area is empty.

 

Similar threads