Simple Coding Help - No Promise.

Does anyone have pivot point calculation on each bar displaying pp, s1, s2, s3 and r1, r2, r3....whichever time frame if we keep it should reflect on these lines...can anyone post it?
 
Thanks a lot colian for your time? will it display on chart? how to make it complete afl?

when we place cursor on each bar...will it display on sides or corner of the page all levels?
 
How do i backtest a pair trading strategy on amibroker ?
I found one from marketcalls with basic ema crossover system, but i am not able to convert it into intraday.
Any help will be very useful.
Thanks
 

amitrandive

Well-Known Member

princy01

Well-Known Member
_SECTION_BEGIN("Open Interest");
p=(100*OpenInt)/Ref(OpenInt,-1)-100;
Plot( p, "% OI" , ParamColor("Color", colorCycle ), ParamStyle( "Style" ) );
_SECTION_END();
i found this AFL code for showing percentage change in open interest based on PREVIOUS DAY open interest values but its not working properly ,please experts can you correct the code ?

regards
 

Raj232

Well-Known Member
i found this AFL code for showing percentage change in open interest based on PREVIOUS DAY open interest values but its not working properly ,please experts can you correct the code ?

regards
What exactly will it show on the chart ? Will it be "just a line" for the previous day's Total open interest ?

or will it be change of open interest for each of the strike prices e.g. 8000, 8050, 8100, 8150, etc .. ? Pls clarify. thanks.
 

princy01

Well-Known Member
What exactly will it show on the chart ? Will it be "just a line" for the previous day's Total open interest ?

or will it be change of open interest for each of the strike prices e.g. 8000, 8050, 8100, 8150, etc .. ? Pls clarify. thanks.
It shows as a line plus numerical information of percentage of open interest added of current day, on basis of previous day closing basis
 

josh1

Well-Known Member
HI friends,

This is AFL for Keltner's Channel.
Code:
_SECTION_BEGIN("Keltner Bands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorDarkTeal );
Style = ParamStyle("Style", styleLine | styleNoLabel);

CenterLine = EMA( P, Periods );
KTop = CenterLine + Width * ATR( Periods );
KBot = CenterLine - Width * ATR( Periods );

Plot( KTop, "KBTop" + _PARAM_VALUES(), Color, styleNoTitle,0,0,1,0,0); 
Plot( KBot, "KBBot" + _PARAM_VALUES(), Color, styleNoTitle,0,0,1,0,0 ); 
Plot( CenterLine, "KMid" + _PARAM_VALUES(), Color,styleNoTitle,0,0,1,0,0 ); 
_SECTION_END();
I want to highlight following patterns

Pattern 1 ----
1. A candle closes below the lower band .i.e. KBot.
2. Immediate next candle closes above the lower band.


Pattern 2 ----
1. A candle closes above the upper band .i.e. KTop.
2. Immediate next candle closes below the upper band.

Alert when pattern complete.
 
This is AFL for Keltner's Channel.
Code:
_SECTION_BEGIN("Keltner Bands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorDarkTeal );
Style = ParamStyle("Style", styleLine | styleNoLabel);

CenterLine = EMA( P, Periods );
KTop = CenterLine + Width * ATR( Periods );
KBot = CenterLine - Width * ATR( Periods );

Plot( KTop, "KBTop" + _PARAM_VALUES(), Color, styleNoTitle,0,0,1,0,0); 
Plot( KBot, "KBBot" + _PARAM_VALUES(), Color, styleNoTitle,0,0,1,0,0 ); 
Plot( CenterLine, "KMid" + _PARAM_VALUES(), Color,styleNoTitle,0,0,1,0,0 ); 
_SECTION_END();
I want to highlight following patterns
Code:
// Pattern 1 ----

A1 = Cross(KBot,C);
A2 = Cross(C,KBot);
Alert01 = Ref(A1,-1) and A2;


// Pattern 2 ----
B1 = Cross(C, KTop);
B2 = Cross(KTop,C);

Alert02 = Ref(B1,-1) and B2;

PlotShapes(Alert01*1,colorWhite,0,L,-12);
PlotShapes(Alert02*2,colorWhite,0,H,-12);

Try and see if this is what you need.
Have plotted arrows you can paste code to give sound alerts or change candle color etc

Thanks



Happy :)
 

Similar threads