Simple Coding Help - No Promise.

Thanks Amit for your reply. This works well for me.


Try this , but first define the line from Right Click on the line and parameters to SU or RE

Code:
_SECTION_BEGIN("Price");
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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("Sound alarm on Trendline Break ");
////////////////////////////// Sound alarm on Trendline Break /////////////////////////////////////

BuySignal = Cross( Close, Study( "SU", GetChartID() ) );
SellSignal = Cross( Study( "SU", GetChartID() ), Close );
ShortSignal = Cross( Study( "RE", GetChartID() ), Close );
CoverSignal = Cross( Close, Study( "RE", GetChartID() ) );
PlotShapes( BuySignal* shapeUpTriangle + SellSignal * shapeDownTriangle, IIf( BuySignal, colorGreen, colorRed ), Offset = -1);
//AlertIf( BuySignal, "SOUND C:\\Windows\\Media\\Ding.wav", "Trendlinebreak alert on "+FullName() + "SheetNumber" + SheetNum, 1, 1+2+4+8, 20 ); //syntax for buy //signal
AlertIf( BuySignal, "SOUND C:\\Windows\\Media\\Ding.wav", "Trendlinebreak alert on "+FullName() , 1, 1+2, 10000 ); //Buy
AlertIf( SellSignal, "SOUND C:\\Windows\\Media\\Ding.wav", "Trendlinebreak alert on "+FullName() , 2, 1+2, 10000 ); //Sell
AlertIf( ShortSignal, "SOUND C:\\Windows\\Media\\Ding.wav", "Trendlinebreak alert on "+FullName() , 3, 1+2, 10000 ); //Short
AlertIf( Coversignal, "SOUND C:\\Windows\\Media\\Ding.wav", "Trendlinebreak alert on "+FullName() , 4, 1+2, 10000 ); //Cover
_SECTION_END();
 

casoni

Well-Known Member
hello to all


need an afl which plots with dotted horizontal lines the high and low of the day till 3pm ( for commodities)



i will see the ieod charts manually for at least 6 months so i need this to see charts manually
can a param option be introduced to select time from 3pm to time of my choice


rgds
you want to plot the Hghest high and lowest low of the day [ i.e hhv and llv from 10:00:00 to 15:00:00 ?? ]
 

casoni

Well-Known Member
check it ,
hope this is what you were looking for


tn = TimeNum();

mode = ParamList("Exc ", "Mcx|Nse",1);
switch( mode )
{
case "Mcx":
tm=100000;
end =IIf(DayOfWeek()==6, 135500,232500);
etime = ParamTime( "mcx Brk Time", "10:30" );
break;
case "Nse":
tm=91500;
end=152500;
etime = ParamTime( "nse Brk Time", "9:25" );
break;
}
cond = (tn >= tm AND tn <= etime) ;
firstBar = cond ;
firstBar = firstBar- Ref( firstBar, -1 );
xH = ValueWhen( cond, HighestSince( firstBar, High ) );
xL = ValueWhen( cond, LowestSince( firstBar, Low ) );
DH = TimeFrameCompress( xH, inDaily, compressLast );
DL = TimeFrameCompress( xL, inDaily, compressLast );
DH = TimeFrameExpand( DH, inDaily, expandFirst );
DL = TimeFrameExpand( DL, inDaily, expandFirst );
dh1=IIf( tn <= etime , DH, Null );
dl1=IIf( tn <= etime , DL, Null );
dh2=IIf( tn >= etime , DH, Null );
dl2=IIf( tn >= etime , DL, Null );
brk_b=Cross(C,dh2);
brk_s=Cross(dl2,C);
Plot( dh1, "",4,styleDashed);
Plot( dl1, "",5,styleDashed);
Plot( dh2, "",4,styleLine);
Plot( dl2, "",5,styleLine);
PlotShapes(brk_b*shapeSmallCircle,ColorRGB(56,176,222),0,dh2,0);
PlotShapes(brk_s*shapeSmallCircle, ColorRGB(205,127,50),0,dl2,0);
Plot(C,"",3,128);

nday = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(nday,"",39,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);

strWeekday = StrMid("SunMonTueWedThuFriSat", SelectedValue(DayOfWeek())*3,3);
Title = EncodeColor(colorWhite)+ "# c_Renko sty-I" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" . "+strWeekday +" . "+ Date() + EncodeColor(47) +
StrFormat("\nOp %g, Hi %g, Lo %g, Cl %g, Vol %g", O, H, L, C, V)
+ EncodeColor(9) +
"\nMarket : " + mode +
"\nStart Time : "+ tm +
"\nBrk Time : "+ etime+
"\nEnd Time : "+ end;
 
Last edited:
check it ,
hope this is what you were looking for


tn = TimeNum();

mode = ParamList("Exc ", "Mcx|Nse",1);
switch( mode )
{
case "Mcx":
tm=100000;
end =IIf(DayOfWeek()==6, 135500,232500);
etime = ParamTime( "mcx Brk Time", "10:30" );
break;
case "Nse":
tm=91500;
end=152500;
etime = ParamTime( "nse Brk Time", "9:25" );
break;
}
cond = (tn >= tm AND tn <= etime) ;
firstBar = cond ;
firstBar = firstBar- Ref( firstBar, -1 );
xH = ValueWhen( cond, HighestSince( firstBar, High ) );
xL = ValueWhen( cond, LowestSince( firstBar, Low ) );
DH = TimeFrameCompress( xH, inDaily, compressLast );
DL = TimeFrameCompress( xL, inDaily, compressLast );
DH = TimeFrameExpand( DH, inDaily, expandFirst );
DL = TimeFrameExpand( DL, inDaily, expandFirst );
dh1=IIf( tn <= etime , DH, Null );
dl1=IIf( tn <= etime , DL, Null );
dh2=IIf( tn >= etime , DH, Null );
dl2=IIf( tn >= etime , DL, Null );
brk_b=Cross(C,dh2);
brk_s=Cross(dl2,C);
Plot( dh1, "",4,styleDashed);
Plot( dl1, "",5,styleDashed);
Plot( dh2, "",4,styleLine);
Plot( dl2, "",5,styleLine);
PlotShapes(brk_b*shapeSmallCircle,ColorRGB(56,176,222),0,dh2,0);
PlotShapes(brk_s*shapeSmallCircle, ColorRGB(205,127,50),0,dl2,0);
Plot(C,"",3,128);

nday = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(nday,"",39,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);

strWeekday = StrMid("SunMonTueWedThuFriSat", SelectedValue(DayOfWeek())*3,3);
Title = EncodeColor(colorWhite)+ "# c_Renko sty-I" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" . "+strWeekday +" . "+ Date() + EncodeColor(47) +
StrFormat("\nOp %g, Hi %g, Lo %g, Cl %g, Vol %g", O, H, L, C, V)
+ EncodeColor(9) +
"\nMarket : " + mode +
"\nStart Time : "+ tm +
"\nBrk Time : "+ etime+
"\nEnd Time : "+ end;

many thanks sir
 

cellclinic

Well-Known Member
Kindly Correct this error ...



check it ,
hope this is what you were looking for


tn = TimeNum();

mode = ParamList("Exc ", "Mcx|Nse",1);
switch( mode )
{
case "Mcx":
tm=100000;
end =IIf(DayOfWeek()==6, 135500,232500);
etime = ParamTime( "mcx Brk Time", "10:30" );
break;
case "Nse":
tm=91500;
end=152500;
etime = ParamTime( "nse Brk Time", "9:25" );
break;
}
cond = (tn >= tm AND tn <= etime) ;
firstBar = cond ;
firstBar = firstBar- Ref( firstBar, -1 );
xH = ValueWhen( cond, HighestSince( firstBar, High ) );
xL = ValueWhen( cond, LowestSince( firstBar, Low ) );
DH = TimeFrameCompress( xH, inDaily, compressLast );
DL = TimeFrameCompress( xL, inDaily, compressLast );
DH = TimeFrameExpand( DH, inDaily, expandFirst );
DL = TimeFrameExpand( DL, inDaily, expandFirst );
dh1=IIf( tn <= etime , DH, Null );
dl1=IIf( tn <= etime , DL, Null );
dh2=IIf( tn >= etime , DH, Null );
dl2=IIf( tn >= etime , DL, Null );
brk_b=Cross(C,dh2);
brk_s=Cross(dl2,C);
Plot( dh1, "",4,styleDashed);
Plot( dl1, "",5,styleDashed);
Plot( dh2, "",4,styleLine);
Plot( dl2, "",5,styleLine);
PlotShapes(brk_b*shapeSmallCircle,ColorRGB(56,176,222),0,dh2,0);
PlotShapes(brk_s*shapeSmallCircle, ColorRGB(205,127,50),0,dl2,0);
Plot(C,"",3,128);

nday = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(nday,"",39,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);

strWeekday = StrMid("SunMonTueWedThuFriSat", SelectedValue(DayOfWeek())*3,3);
Title = EncodeColor(colorWhite)+ "# c_Renko sty-I" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" . "+strWeekday +" . "+ Date() + EncodeColor(47) +
StrFormat("\nOp %g, Hi %g, Lo %g, Cl %g, Vol %g", O, H, L, C, V)
+ EncodeColor(9) +
"\nMarket : " + mode +
"\nStart Time : "+ tm +
"\nBrk Time : "+ etime+
"\nEnd Time : "+ end;
 
hello experts,

i hope i am posting this in the right place :) i wanted to use 2 different explorations to list the stocks matching the below criteria:

1. Fast%K crossed 20 from bottom (daily,weekly,monthly)
2. +DI above -DI (daily, weekly, monthly)

i tried the best i could with the limited knowledge that i have but could not get it working. i could list the stocks that are above Fast%K 20 but could not figure out how to validate if it crossedover from below. simiarly, i was able to list the stocks with their respective +DI and +DI values but could not validate if +DI > -DI

here is what i came up with:

1. Fast%K crossed 20 from bottom - Daily

Filter=1;
TimeFrameSet(inDaily);
pds = Param("Periods",8,2,20); /*Periods */
L8=LLV(L,pds);
H8=HHV(H,pds);
FastK = 100*((C-L8)/(H8-L8));
AddColumn(FastK,"FastK");
TimeFrameRestore();

here the value of FastK is captured but not sure how to check if it crossed from below
i was thinking of capturing the FastK value of the previous period and then compare both of them. however i could not figure out how to do it. no experience coding.

2. +DI above -DI - Daily

TimeFrameSet(inDaily);
A=pdi(period=14);
B=mdi(period=14);
OutputinDaily = Iff(A>B,Yes,No);
AddColumn(OutputinDaily,"DailyCrossOver");
TimeFrameRestore();

i reach out to the experts here and seek your assistance in completing the above scripts. my sincere apologies if the script that i came up with is incorrect. hope to become better as time passes by :)

thanks and regards to this awesome forum and the members
 

Similar threads