need help to plot buy/sell arrow when both line crossing ( red n yellow)

pareshR

Well-Known Member
#1
hello
i got this afl from www.tradewithme.me

i need help to plot buy/sell arrow when both line crossing ( red n yellow)
thx




color = ParamColor( "Color", colorRed);
style = ParamStyle( "Style", styleThick);
label = ParamStr( "label text", "Hull_JMA" );

Price = ParamField("Price");
Period = Param("Period", 10,1,100,1);

function HMA1(Price, Period)
{
return WMA(2*WMA(Price, Period/2)-WMA(Price, Period), sqrt(Period));
}

function JMA1( array, per )
{
TN1=MA(array,per);
s1=0;
for( i = 0; i < per; i=i+1 )
{
s1=s1+((per-(2*i)-1)/2)*Ref(array,-i);
}
return TN1+(((per/2)+1)*S1)/((per+1)*per);
}

a=Param("Hull_JMA",25,1,100,1);
k=Param("Period",10,1,100,1);

L = HMA1(C,k);
M=JMA1(C,k);
N=((L*a)+(M*(100-a)))/100;

Plot( N, label, color, style);
Plot (MA(C,50),"",colorYellow,styleLine);
Plot (C,"Close",colorWhite,styleCandle);
 

jagankris

Well-Known Member
#2
hello
i got this afl from www.tradewithme.me

i need help to plot buy/sell arrow when both line crossing ( red n yellow)
thx
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();


color = ParamColor( "Color", colorRed);
style = ParamStyle( "Style", styleThick);
label = ParamStr( "label text", "Hull_JMA" );

Price = ParamField("Price");
Period = Param("Period", 10,1,100,1);

function HMA1(Price, Period)
{
return WMA(2*WMA(Price, Period/2)-WMA(Price, Period), sqrt(Period));
}

function JMA1( array, per )
{
TN1=MA(array,per);
s1=0;
for( i = 0; i < per; i=i+1 )
{
s1=s1+((per-(2*i)-1)/2)*Ref(array,-i);
}
return TN1+(((per/2)+1)*S1)/((per+1)*per);
}

a=Param("Hull_JMA",25,1,100,1);
k=Param("Period",10,1,100,1);

L = HMA1(C,k);
M=JMA1(C,k);
N=((L*a)+(M*(100-a)))/100;
MA50 = MA(C,50);

Plot( N, label, colorBlue, styleLine);
Plot (MA(C,50),"",colorRed,styleLine);
Plot (C,"Close",colorWhite,styleCandle);

Buy = Cross(N,MA50);
Sell = Cross(MA50,N);
Short = Sell;
Cover = Buy;
// plot arrows
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
 

Similar threads