Simple Coding Help - No Promise.

Seniors,
I wanted to plot Daily values of the following indicator on hourly chart with hourly values also. I am now to coding. Please help me.

//JNSAR - Indicator ideated by Mr Illango

_SECTION_BEGIN("JNSAR");

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

Period = Param("Length",5,5,100,1);

// JNSAR = (5 days HEma+5Days CEma+5Days LEma)/15

isum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));

jnsar = round(isum/15);

buy = Cross(Close, jnsar);
sell =Cross(jnsar,Close);

Short = Sell;
Cover = Buy;

color = IIf(C>jnsar,colorGreen,colorRed);

Plot(jnsar,"JNSAR",color,styleDots|styleNoLine|stylethick);

_SECTION_END();
Thanks in advance.
 

toughard

Well-Known Member
Friends I need to plot fresh 5 ema on 5 min chart daily.
Means, 5 ema should start getting plotted on 6th bar of the day and end on 3.30pm today
next day same should happen ans it should not get continue from last day.
can any one help please. thanks
 
Dear Seniors,
Please help me for coding this AFL. I wanted to plot below mentioned afl's daily value (one line), hourly value (dotted Staircase) and 5 Minute value all three on 5 Minute chart. I have tried and wasted much time.
Kindly help me when time permits.

//JNSAR - Indicator ideated by Mr Illango

_SECTION_BEGIN("JNSAR");

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

Period = Param("Length",5,5,100,1);

// JNSAR = (5 days HEma+5Days CEma+5Days LEma)/15

isum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));

jnsar = round(isum/15);

buy = Cross(Close, jnsar);
sell =Cross(jnsar,Close);

Short = Sell;
Cover = Buy;

color = IIf(C>jnsar,colorGreen,colorRed);

Plot(jnsar,"JNSAR",color,styleDots|styleNoLine|stylethick);

_SECTION_END();
Thanks in advance.
 
Dear Seniors,
Please help me for coding this AFL. I wanted to plot below mentioned afl's daily value (one line), hourly value (dotted Staircase) and 5 Minute value all three on 5 Minute chart. I have tried and wasted much time.
Kindly help me when time permits.

Thanks in advance.
Hope this helps. Thnx
Code:
_SECTION_BEGIN("Multi Timeframe JNSAR");

//JNSAR - Indicator ideated by Mr Illango

Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Period = Param("Length",5,5,100,1);

//.............Daily Timeframe JNSAR ......................
DJNSARclrUp = Paramcolor("Daily JNSAR Up color",colorAqua);
DJNSARclrDn = Paramcolor("Daily JNSAR Dn color",colorOrange);
DJNSARwidth = Param("Daily JNSAR Width",3,1,5,1);

TimeFrameSet(inDaily);
disum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
djnsar = round(disum/15);
TimeFrameRestore();

dhjnsar = Timeframeexpand(djnsar,inDaily, expandfirst);
djnsarclr = IIf(C>djnsar,DJNSARclrUp,DJNSARclrDn);

Plot(dhjnsar,"",djnsarclr,styledots|stylenoline|styleNoRescale,0,0,0,0,DJNSARwidth);

//.............Hourly Timeframe JNSAR ..............
HJNSARclrUp = Paramcolor("Hourly JNSAR Up color",colorbrightgreen);
HJNSARclrDn = Paramcolor("Hourly JNSAR Dn color",colordarkred);
HJNSARwidth = Param("Hourly JNSAR Width",2,1,5,1);

TimeFrameSet(inhourly);
hisum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
hjnsar = round(hisum/15);
TimeFrameRestore();

hhjnsar = Timeframeexpand(hjnsar,inHourly, expandfirst);
hjnsarclr = IIf(C>hjnsar,HJNSARclrUp,HJNSARclrDn);

Plot(hhjnsar,"",hjnsarclr,styledashed|stylestaircase|styleNoRescale,0,0,0,0,HJNSARwidth);
//====================
//................Flexible/Other Choice Timeframe JNSAR .........
jnsartf = Param("Flexible JNSAR Time frame (min)",15,1,1440,1);
jnsartfrm = in1Minute*jnsartf;

FJNSARclrUp = Paramcolor("Flexible TF JNSAR Up color",colorteal);
FJNSARclrDn = Paramcolor("Flexible TF JNSAR Dn color",colorplum);
FJNSARwidth = Param("Flexible TF JNSAR Width",1,1,5,1);

TimeFrameSet(jnsartfrm);
fisum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
fjnsar = round(fisum/15);
TimeFrameRestore();

fjnsar = Timeframeexpand(fjnsar,jnsartfrm, expandfirst);
fjnsarclr = IIf(C>fjnsar,FJNSARclrUp,FJNSARclrDn);

Plot(fjnsar,"",fjnsarclr,styledashed|stylestaircase|styleNoRescale,0,0,0,0,FJNSARwidth);
//=====================

//..............Chart Timeframe JNSAR ..................

// JNSAR = (5 days HEma+5Days CEma+5Days LEma)/15
isum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
jnsar = round(isum/15);
buy = Cross(Close, jnsar);
sell =Cross(jnsar,Close);
Short = Sell;
Cover = Buy;
color = IIf(C>jnsar,colorGreen,colorRed);

Plot(jnsar,"JNSAR",color,styleLine|stylenorescale);
PlotShapes(Buy*shapeUpArrow,colorGreen,0,L,-15);
PlotShapes(Sell*shapedownArrow,colorred,0,H,-15);

//===================


_SECTION_END();
 
Support and Resistance with ORB Breakout Strategy April 9 2020
_______________________________________________________________


Calculate Support / Resistance Levels as follows :
__________________________________________________

R4 = R3 + (R2 - R1)
R3 = R1 + (HIGH - LOW )
R2 = PIVOT + (HIGH - LOW )
R1 = 2 X ( PIVOT - LOW )

S1 = 2 X ( PIVOT - HIGH )
S2 = PIVOT - ( HIGH - LOW )
S3 = S1 - ( HIGH - LOW )
S4 = S3 - (S1 - S2 )

** By using the above same formula, calculate the Weekly S-R / MONTHLY S-R

***** Draw Previous Day's High Line

( similarly enable / disable Weekly/ Monthly High lines )

***** Draw Previous Day's Low Line

( similarly enable / disable Weekly/ Monthly Low lines )


Now on to the BUY / SELL PART :
________________________________

First 15 minutes ( 3 Five Minute Candles ) High is to be marked as ORB HIGH
First 15 minutes ( 3 Five Minute Candles ) Low is to be marked as ORB LOW

Alert in Scanner as well in Chart for Buy Entry :
_________________________________________________

Rule 1 : Atleast one candle ( one Five minute candle) must close above ORB HIGH
Rule 2 : Atleast one candle must close above Previous Day's High value
Rule 3 : Atleast one candle must close above Current Day's R1 and close below R2 ( Should not touch R2/R3/R4 )

(sometimes a single candle satisfy all this rules, that also valid)

If All rules matches, point out a buy arrow in a new candle's open price

Alert in Scanner as well in Chart for Sell Entry :
_________________________________________________

Rule 1 : Atleast one candle ( one Five minute candle) must close below ORB LOW
Rule 2 : Atleast one candle must close above Previous Day's Low value
Rule 3 : Atleast one candle must close below Current Day's S1 and close above S2 ( Should not touch S2/S3/S4 )

(sometimes a single candle satisfy all this rules, that also valid)

If All rules matches, point out a sell arrow in a new candle's open price



***************************************************************************************************************************************************
Trades for Intraday only

Trades for NSE CASH/FNO SEGMENT ONLY

Trades to be closed by 3 pm

No new signals to be accepted after 2. 45 PM

***************************************************************************************************************************************************
 
Logic Description with screenshots, for buy/buy exit/sell/sell exit and with stoploss all are explained in the screenshots, i request any experienced coder to help on this
 

Attachments

Hope this helps. Thnx
Code:
_SECTION_BEGIN("Multi Timeframe JNSAR");

//JNSAR - Indicator ideated by Mr Illango

Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Period = Param("Length",5,5,100,1);

//.............Daily Timeframe JNSAR ......................
DJNSARclrUp = Paramcolor("Daily JNSAR Up color",colorAqua);
DJNSARclrDn = Paramcolor("Daily JNSAR Dn color",colorOrange);
DJNSARwidth = Param("Daily JNSAR Width",3,1,5,1);

TimeFrameSet(inDaily);
disum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
djnsar = round(disum/15);
TimeFrameRestore();

dhjnsar = Timeframeexpand(djnsar,inDaily, expandfirst);
djnsarclr = IIf(C>djnsar,DJNSARclrUp,DJNSARclrDn);

Plot(dhjnsar,"",djnsarclr,styledots|stylenoline|styleNoRescale,0,0,0,0,DJNSARwidth);

//.............Hourly Timeframe JNSAR ..............
HJNSARclrUp = Paramcolor("Hourly JNSAR Up color",colorbrightgreen);
HJNSARclrDn = Paramcolor("Hourly JNSAR Dn color",colordarkred);
HJNSARwidth = Param("Hourly JNSAR Width",2,1,5,1);

TimeFrameSet(inhourly);
hisum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
hjnsar = round(hisum/15);
TimeFrameRestore();

hhjnsar = Timeframeexpand(hjnsar,inHourly, expandfirst);
hjnsarclr = IIf(C>hjnsar,HJNSARclrUp,HJNSARclrDn);

Plot(hhjnsar,"",hjnsarclr,styledashed|stylestaircase|styleNoRescale,0,0,0,0,HJNSARwidth);
//====================
//................Flexible/Other Choice Timeframe JNSAR .........
jnsartf = Param("Flexible JNSAR Time frame (min)",15,1,1440,1);
jnsartfrm = in1Minute*jnsartf;

FJNSARclrUp = Paramcolor("Flexible TF JNSAR Up color",colorteal);
FJNSARclrDn = Paramcolor("Flexible TF JNSAR Dn color",colorplum);
FJNSARwidth = Param("Flexible TF JNSAR Width",1,1,5,1);

TimeFrameSet(jnsartfrm);
fisum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
fjnsar = round(fisum/15);
TimeFrameRestore();

fjnsar = Timeframeexpand(fjnsar,jnsartfrm, expandfirst);
fjnsarclr = IIf(C>fjnsar,FJNSARclrUp,FJNSARclrDn);

Plot(fjnsar,"",fjnsarclr,styledashed|stylestaircase|styleNoRescale,0,0,0,0,FJNSARwidth);
//=====================

//..............Chart Timeframe JNSAR ..................

// JNSAR = (5 days HEma+5Days CEma+5Days LEma)/15
isum = (Sum(ema(High,Period),Period) + Sum(ema(Low,Period),period) + Sum(ema(Close,Period),period));
jnsar = round(isum/15);
buy = Cross(Close, jnsar);
sell =Cross(jnsar,Close);
Short = Sell;
Cover = Buy;
color = IIf(C>jnsar,colorGreen,colorRed);

Plot(jnsar,"JNSAR",color,styleLine|stylenorescale);
PlotShapes(Buy*shapeUpArrow,colorGreen,0,L,-15);
PlotShapes(Sell*shapedownArrow,colorred,0,H,-15);

//===================


_SECTION_END();
Dear bbhanushali,

Thank you very much
 

Similar threads