Simple Coding Help - No Promise.

xsis

Active Member
can we have a simple afl exploration which tells you about continuous range (high to low) contraction & expansion for n number of days?

this is basically to get stocks which mite breakout either side after continuous range contraction or stocks which cool off after a continuous expansion. the latter ones wud be low in number. but still will help trader to take trading decisions.

for example if, TCS daily range is continuously contracting like 30, 25, 24, 21, 18, 17, 15, 10 and if i want to explore with n=8 (days), i shud get TCS when its range has contracted to 10.

similarly the reverse way for range expansion!

this is different than NR setups and the unique/important point is continuous range contraction/expansion!!

can the esteemed coders please help me in getting this code!!??
 
Last edited:
Please help with coding this

Modified open = (previous modified open + previous modified close)/2

Modified close = (modified open + high + low + close)/4
Its an egg/hen problem :D

Your MO is based on MC and MC is based on MO, circular reference . . .


Code:
Modified close = ([B]modified open[/B] + high + low + close)/4

substituting for MO

Modified close = ([B][I](previous modified open + previous modified close)/2[/I][/B] + high + low + close)/4
but there is a way around to this

define first bar values as equal to open & close and then derive rest in a for barcount loop


:) Happy
 
Its an egg/hen problem :D

Your MO is based on MC and MC is based on MO, circular reference . . .


Code:
Modified close = ([B]modified open[/B] + high + low + close)/4

substituting for MO

Modified close = ([B][I](previous modified open + previous modified close)/2[/I][/B] + high + low + close)/4
but there is a way around to this

define first bar values as equal to open & close and then derive rest in a for barcount loop


:) Happy
Thanks for explaining, am still feeling stumped. Am new to coding, if its not too much of a hassle could you please write the code?
 

pratapvb

Well-Known Member
Please help with coding this

Modified open = (previous modified open + previous modified close)/2

Modified close = (modified open + high + low + close)/4
Is it supposed to finally look something like this?

 

xsis

Active Member
any body pls?

can we have a simple afl exploration which tells you about continuous range (high to low) contraction & expansion for n number of days?

this is basically to get stocks which mite breakout either side after continuous range contraction or stocks which cool off after a continuous expansion. the latter ones wud be low in number. but still will help trader to take trading decisions.

for example if, TCS daily range is continuously contracting like 30, 25, 24, 21, 18, 17, 15, 10 and if i want to explore with n=8 (days), i shud get TCS when its range has contracted to 10.

similarly the reverse way for range expansion!

this is different than NR setups and the unique/important point is continuous range contraction/expansion!!

can the esteemed coders please help me in getting this code!!??
 
Hi

Im using TICK chart. Im using 100 Ticks to complete One candle. But not understanding how many ticks till now completed.. and hoe many ticks need to complete that candle.

Can u help me with that code.

By looking ticks left i can guees approx timing to comple that candle.

Plz write code for that.

I need like this:
If i select chart as 100 ticks
Ticks completed:40 ticks Left:60

Plz help me.
 

Nehal_s143

Well-Known Member
Pratap Sir, Happy Sir

please guide me on this

hi

I am using hourly pivot for finding intraday trend using below afl

If price close below upper range and above lower range then color is yellow in ribbon IIf(C<HPPU AND C>HPPL,colorYellow,31))); at some places (not at all places) color is coming yellow and some places color is coming blue instead of yellow

please see image marked 3 lines ribbon should show yellow instead of blue




please help me to correct the error/code




_SECTION_BEGIN("PriceCandle");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorPink ), styleNoTitle | styleCandle|styleNoLabel );
_SECTION_END();


_SECTION_BEGIN("Hourly Levels");
//////////////////////////////////HOURLY /////////////////////////////////
HH= TimeFrameGetPrice( "H", inHourly, -1) ;
HL= TimeFrameGetPrice( "L", inHourly, -1) ;
HC= TimeFrameGetPrice( "C", inHourly, -1) ;


HPP = (HH + HL + HC)/3;



// PARAMETERS
SHALD = ParamList("HOURLY Pivots", "selected only|all|hide" );

//day
PDP = ParamList("HPP", "SHOW|HIDE" );

HPP2 = (HH + HL)/2;

HPPU = HPP+(HPP-HPP2);
HPPL = HPP-(HPP-HPP2);

// PLOTS
style = IIf(ParamList("Chart style", "styleCandle|styleBar")=="styleCandle",64,128);
//Plot (C,Date ()+" close",11,style);
//day
if ((PDP=="SHOW" OR SHALD=="all") && SHALD!="hide")

Plot (Hpp,"HOURLY Pivot",colorGold,1);PlotText( "HPP : "+Hpp+"", BarCount+3, LastValue(Hpp), colorLime,1);
Plot(HPPU, "",colorGold,styleDashed);
Plot(HPPL, "",colorGold,styleDashed);
//PlotOHLC(PPL,PPU,PPL,PPU,"",colorSkyblue,styleCloud | styleNoLabel);


_SECTION_END();

myc=IIf(C>HPPU,colorBlue,
IIf(C<HPPL,colorRed,//31));
IIf(C<HPPU AND C>HPPL,colorYellow,31)));

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

Similar threads