Simple Coding Help - No Promise.

pratapvb

Well-Known Member
you can also do

NF 3min and 60min and bnf 3min and 60min or whatever other scrip combos with 21ema on diff panes

 

pratapvb

Well-Known Member
code for above

Code:
_SECTION_BEGIN("HighVol");
SetChartOptions(0,chartShowArrows|chartShowDates|chartWrapTitle);
SetChartBkColor(ParamColor("Background", colorLightGrey)) ;

useforeign = ParamToggle("Set Foreign", "No|Yes", 0) ;
List = GetCategorySymbols(categoryMarket, 0) ;
forscript = ParamList("Scrip", List, 0) ;
if (useforeign)
	SetForeign(forscript); 

settf = ParamToggle("Set TF", "No|Yes", 0) ;
tf = Param("TF", 5, 1, 100000, 1) ;

if (settf)
{
	SetChartOptions(3,chartShowDates);
	TimeFrameSet(tf*in1Minute) ;
}

Layer = Param("Layer", 0, -5, 5, 1) ;
if (settf)
	tz = NumToStr(tf, 8.0) +"-minute";
else
	tz = NumToStr(Interval()/in1Minute, 8.0) +"-minute";
//_N(Title = StrFormat(Name() + " " +tz + " " + NumToStr(ddt, formatDateTime) + " Range %g {{VALUES}}", SelectedValue( dh-dl) ));
_N(Title = StrFormat(Name()+tz+ NumToStr(DateTime(), formatDateTime)+ EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g,  " + EncodeColor( colorRed ) + " Lo %g,  " + EncodeColor( colorBlack ) + " Close %g (%.1f%%){{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close",  colorBlack, styleNoTitle | styleCandle,0,0,0,Layer ); 
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;

if (settf)
{
Daych = Day() != Ref(Day(), -1) ;
Plot(IIf(Daych, 100, 0), "", colorBlack, styleHistogram|styleNoLabel|styleOwnScale, 0, 100, 0, -5) ;
}
//Peaking Volumes
HiVolume = IIf(V > (2 * MA(V,10)), True, False); 
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
//TimeFrameRestore()
_SECTION_END();
 

VJAY

Well-Known Member
code for above

Code:
_SECTION_BEGIN("HighVol");
SetChartOptions(0,chartShowArrows|chartShowDates|chartWrapTitle);
SetChartBkColor(ParamColor("Background", colorLightGrey)) ;

useforeign = ParamToggle("Set Foreign", "No|Yes", 0) ;
List = GetCategorySymbols(categoryMarket, 0) ;
forscript = ParamList("Scrip", List, 0) ;
if (useforeign)
	SetForeign(forscript); 

settf = ParamToggle("Set TF", "No|Yes", 0) ;
tf = Param("TF", 5, 1, 100000, 1) ;

if (settf)
{
	SetChartOptions(3,chartShowDates);
	TimeFrameSet(tf*in1Minute) ;
}

Layer = Param("Layer", 0, -5, 5, 1) ;
if (settf)
	tz = NumToStr(tf, 8.0) +"-minute";
else
	tz = NumToStr(Interval()/in1Minute, 8.0) +"-minute";
//_N(Title = StrFormat(Name() + " " +tz + " " + NumToStr(ddt, formatDateTime) + " Range %g {{VALUES}}", SelectedValue( dh-dl) ));
_N(Title = StrFormat(Name()+tz+ NumToStr(DateTime(), formatDateTime)+ EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g,  " + EncodeColor( colorRed ) + " Lo %g,  " + EncodeColor( colorBlack ) + " Close %g (%.1f%%){{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close",  colorBlack, styleNoTitle | styleCandle,0,0,0,Layer ); 
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;

if (settf)
{
Daych = Day() != Ref(Day(), -1) ;
Plot(IIf(Daych, 100, 0), "", colorBlack, styleHistogram|styleNoLabel|styleOwnScale, 0, 100, 0, -5) ;
}
//Peaking Volumes
HiVolume = IIf(V > (2 * MA(V,10)), True, False); 
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
//TimeFrameRestore()
_SECTION_END();
Dear Pratap,
Thanks again...I think thanks is only just a formal...you guys(you & happy)doing more than any kind appreciation.....hats off to you for your selfless sharing :clapping:
 

Trader_PK

Well-Known Member
code for above

Code:
_SECTION_BEGIN("HighVol");
SetChartOptions(0,chartShowArrows|chartShowDates|chartWrapTitle);
SetChartBkColor(ParamColor("Background", colorLightGrey)) ;

useforeign = ParamToggle("Set Foreign", "No|Yes", 0) ;
List = GetCategorySymbols(categoryMarket, 0) ;
forscript = ParamList("Scrip", List, 0) ;
if (useforeign)
	SetForeign(forscript); 

settf = ParamToggle("Set TF", "No|Yes", 0) ;
tf = Param("TF", 5, 1, 100000, 1) ;

if (settf)
{
	SetChartOptions(3,chartShowDates);
	TimeFrameSet(tf*in1Minute) ;
}

Layer = Param("Layer", 0, -5, 5, 1) ;
if (settf)
	tz = NumToStr(tf, 8.0) +"-minute";
else
	tz = NumToStr(Interval()/in1Minute, 8.0) +"-minute";
//_N(Title = StrFormat(Name() + " " +tz + " " + NumToStr(ddt, formatDateTime) + " Range %g {{VALUES}}", SelectedValue( dh-dl) ));
_N(Title = StrFormat(Name()+tz+ NumToStr(DateTime(), formatDateTime)+ EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g,  " + EncodeColor( colorRed ) + " Lo %g,  " + EncodeColor( colorBlack ) + " Close %g (%.1f%%){{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close",  colorBlack, styleNoTitle | styleCandle,0,0,0,Layer ); 
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;

if (settf)
{
Daych = Day() != Ref(Day(), -1) ;
Plot(IIf(Daych, 100, 0), "", colorBlack, styleHistogram|styleNoLabel|styleOwnScale, 0, 100, 0, -5) ;
}
//Peaking Volumes
HiVolume = IIf(V > (2 * MA(V,10)), True, False); 
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
//TimeFrameRestore()
_SECTION_END();
Pratap this is for VOLume..I dont find aget diffrnt time frame..are you sure this is one correct?
 

pratapvb

Well-Known Member
Pratap this is for VOLume..I dont find aget diffrnt time frame..are you sure this is one correct?
check param....setforiegn yes/no and settf yes/no

By now you should know my AFL flexibility is all in the params :D
 

Nehal_s143

Well-Known Member
Hi I want to use below afl on 10 min using time frame expand, i tried with 2 different way but both are giving wrong value, please correct the error

_N(Title = StrFormat(FullName() + " {{INTERVAL}} {{DATE}} Open %g, High %g, Low %g, Close %g (%.1f%%) Volume " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C,
SelectedValue( ROC( C, 1 )) ));
Period = Param( "Length", 10, 1, 25, 1, 1 );
RVI = 0;
Signals = 0;


Con1 = ( ( C - O ) + ( 2 * Ref( C - O, -1 ) ) + ( 2 * Ref( C - O, -2 ) ) + Ref( C - O, -3 ) ) / 6;
Con2 = ( ( H - L ) + ( 2 * Ref( H - L, -1 ) ) + ( 2 * Ref( H - L, -2 ) ) + Ref( H - L, -3 ) ) / 6;

A = Sum( Con1, Period );
B = Sum( Con2, Period );

RVI = IIf( B != 0, A / B, RVI );
Signals = Ref( RVI, -1 );


Plot( RVI, "Relative Vigor Index", colorLightBlue );
Plot( Signals, "Signals", colorRed );
Plot( 0 , "", colorBlack, styleDashed );

RVIBL=RVI>0;
RVIBR=RVI<0;

mycRVI=IIf(RVIBL,colorBlue,
IIf(RVIBR,colorRed,31));

Plot(6, "ribbon", mycRVI, styleOwnScale| styleArea|styleNoLabel,-0.5,100);



_SECTION_END();


1st method
========

_SECTION_BEGIN("RVI 10min");
tf=Param("Time Frame (min)",10,1,10,1);tfrm=in1Minute*tf;
TimeFrameSet(tfrm);

Period = Param( "Length", 10, 1, 25, 1, 1 );
RVI = 0;
Signals = 0;


Con1 = ( ( C - O ) + ( 2 * Ref( C - O, -1 ) ) + ( 2 * Ref( C - O, -2 ) ) + Ref( C - O, -3 ) ) / 6;
Con2 = ( ( H - L ) + ( 2 * Ref( H - L, -1 ) ) + ( 2 * Ref( H - L, -2 ) ) + Ref( H - L, -3 ) ) / 6;

A = Sum( Con1, Period );
B = Sum( Con2, Period );

TimeFrameRestore();

RVI2 = IIf( B != 0, A / B, RVI );

RVI2f = TimeFrameExpand( RVI2, tfrm);

RVIBL=RVI2f>0;
RVIBR=RVI2f<0;

mycRVI2=IIf(RVIBL,colorBlue,
IIf(RVIBR,colorRed,31));

Plot(6, "ribbon", mycRVI2, styleOwnScale| styleArea|styleNoLabel,-0.5,100);

_SECTION_END();

2nd method
=========

_SECTION_BEGIN("RVI 10min");
tf=Param("Time Frame (min)",10,1,10,1);tfrm=in1Minute*tf;
TimeFrameSet(tfrm);

Period = Param( "Length", 10, 1, 25, 1, 1 );
RVI = 0;
Signals = 0;


Con1 = ( ( C - O ) + ( 2 * Ref( C - O, -1 ) ) + ( 2 * Ref( C - O, -2 ) ) + Ref( C - O, -3 ) ) / 6;
Con2 = ( ( H - L ) + ( 2 * Ref( H - L, -1 ) ) + ( 2 * Ref( H - L, -2 ) ) + Ref( H - L, -3 ) ) / 6;

A = Sum( Con1, Period );
B = Sum( Con2, Period );

RVI2 = IIf( B != 0, A / B, RVI );

RVIBL=RVI2>0;
RVIBR=RVI2<0;

TimeFrameRestore();

RVIBL2=RVI2>0;
RVIBR2=RVI2<0;

RVIBL2f = TimeFrameExpand( RVIBL2, tfrm);
RVIBR2f = TimeFrameExpand( RVIBR2, tfrm);


mycRVI2=IIf(RVIBL2f,colorBlue,
IIf(RVIBR2f,colorRed,31));

Plot(6, "ribbon", mycRVI2, styleOwnScale| styleArea|styleNoLabel,-0.5,100);

_SECTION_END();



Uploaded with ImageShack.us
 

amitrandive

Well-Known Member
Happy Singh

Below is an exploration for daily,hourly,30 min,15 min and 5 min change in the price .

1)Scenario One:I need for it to plot and explore a buy signal when all the differences are positive and a sell signal when all the differences are negative,irrespective of colour code of the difference.

2)Scenario Two:I need for it to plot and explore a buy signal when all the differences except the daily are positive and a sell signal when all the differences except the daily are negative,irrespective of colour code of the difference.

Code:
//% chg in mtf
TimeFrameSet(inDaily);
diffd = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diffd1=TimeFrameExpand(diffd,inDaily);

TimeFrameSet(inHourly);
diffh = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diffh1=TimeFrameExpand(diffh,inHourly);

TimeFrameSet(in15Minute*2);
diff30 = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diff30a=TimeFrameExpand(diff30,in15Minute*2);

TimeFrameSet(in15Minute);
diff15 = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diff15a=TimeFrameExpand(diff15,in15Minute);

TimeFrameSet(in5Minute);
diff5 = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diff5a=TimeFrameExpand(diff5,in5Minute);
Plot(C,"",47,128);
Filter=1;
AddColumn(diffd1,"daily chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diffh1,"60m chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diff30a,"30m chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diff15a,"15 chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diff5a,"5m chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
 
is this t3b , shared by tipstsr , a few yrs before on tj ;i am searching it since than ;
can it's afl can be shared here in this thread , if u r comfortable with it .......also can u find it useful as high profitable as claim by them ..........
Amit randive, Labhdi

I also only have the image. I did attend paid T3B training and in process of putting the AFL together ....
 
Good :)


I would use styleownscale on all of them and adjust them to plot below/above price, also to create space for the plots (shift the price up/down) instead of graph space I would use Highest /Lowest Visible value and plot an invisible line . . .


:) Happy
yes, styleOwnScale is definite requirement. Trick to restrict the size is min and max of the Plot function. Even though indicator is having value of 1 to 10, I've set min/max on plot to 1, 200. This leaves rest of the screen untouched by that indicator.

I suppose same can also be done with combination of SetChartOption, PlotGrid

Italicized parts highlighted in your reply, I understood little-little.
Bold Part : Total bouncer gaya...

I don't use GraphSpace
 

Nehal_s143

Well-Known Member
Amit randive, Labhdi

I also only have the image. I did attend paid T3B training and in process of putting the AFL together ....
T3B charge Rs.16750/- for a year, is it worth spending 17k ?? month wise less then 1500 is ok, but yearly together without knowing the result....for small trader like me not affordable
 

Similar threads