Simple Coding Help - No Promise.

sr114

Well-Known Member
the small circle - on the plot is the acatual bar on which the calc is valid
the arrow is plotted on the completion of the calc bar

so when the small circle is plotted - be ready to get on the trade - may be on open or put some limit values
 
the small circle - on the plot is the acatual bar on which the calc is valid
the arrow is plotted on the completion of the calc bar

so when the small circle is plotted - be ready to get on the trade - may be on open or put some limit values

Does the code given show the lower part of the chart also sir???
 
mention your exact rules, coding buy sell will not be difficult....
a=1;

_SECTION_BEGIN("HeikenAshiSmoothed");
GraphXSpace=5;
p=200; //DEFAULT 5 final50
Om=DEMA(O,p);
Hm=DEMA(H,p);
lm=DEMA(L,p);
Cm=DEMA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
HaOpen = AMA( Ref( HaClose, 1), 1);
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );

slope = Param("slope",2,2,100,1);
Color20= IIf(LinRegSlope(MA(HaClose,a),slope)>10,colorRed,colorGreen);

Plot(MA(HaClose,a),"", color20,styleThick);// for buy


Color=IIf(Haclose>MA(HaClose,a),colorGreen, colorRed);
_SECTION_END();


//Buy=Color==colorGreen;
//Sell=Color==colorRed;

//Buy=ExRem(Buy,Sell);
//Sell=ExRem(Sell,Buy);

//PlotShapes(IIf(Buy , shapeUpArrow, shapeNone),colorGreen);
//PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed);




b=1; //DEFAULT 20//CHANGED BY MOMIN//

_SECTION_BEGIN("HeikenAshiSmoothed");
GraphXSpace=5;
p=205; //DEFAULT 5 final50 //for red line
Om=DEMA(O,p);
hm=DEMA(H,p);
lm=DEMA(L,p);
Cm=DEMA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
HaOpen = AMA( Ref( HaClose, 1), 1);
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );

slope = Param("slope",2,2,100,1);
Color20= IIf(LinRegSlope(MA(HaClose,b),slope)<100,colorRed,colorGreen);

Plot(MA(HaClose,b),"", color20,styleThick);//for sale

Color=IIf(Haclose>MA(HaClose,b),colorGreen, colorRed);

_SECTION_END();


Buy=Color==colorGreen;
Sell=Color==colorRed;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

PlotShapes(IIf(Buy , shapeUpArrow, shapeNone),colorGreen);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed);






//MOMIN//////////////////
_SECTION_BEGIN("Magfied Market Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorYellow) );
Hor=Param("Horizontal Position",1480,1,1800,1);
Ver=Param("Vertical Position",12,1,830,1);
GfxTextOut(""+C, Hor-690 , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 11, 700, True );
GfxSetBkMode( colorBlack );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor-690 , Ver+45 );



/////MOMIN///////

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
_SECTION_END();



Buy and Sell Signal is not generating when EMA Line is crossing each other .
Please help.
 

sr114

Well-Known Member
OSMA nd MOM afl - put t in the lower pane

for (i=1; i<BarCount; i++)
{
HaClose = (Open+High+Low+Close) / 4;
}

// plots
CenterLine = 0;

procedure SaveRestorePrices( DoSave )
{
global SaveC;

if( DoSave )
{
HaClose[0] = (Open[0]+High[0]+Low[0]+Close[0]) / 4;

}
else
{

Close = HaClose;
}
}

SaveRestorePrices( True );

function Momentum( array, period )
{
return (array /Ref( array, -period ))*100;
}

customArray = ( Haclose );

Close = customArray;

SaveRestorePrices( False );

OsMA=MACD( 12, 26 )-Signal( 12, 26, 9 );


OsMAColor=IIf( OsMA > CenterLine,colorSeaGreen, colorOrange);
Plot (OsMA, "\nOsMA ", OsMAColor,styleHistogram|styleThick|styleOwnScale );
Plot(Momentum( Haclose, 14 ),"\nMOM1",colorBlue,1|styleOwnScale|styleThick );

Title = "";

//by Vidyasagar, [email protected]//
FS=Param("Font Size",11,8,100,1);
GfxSelectFont("Verdana", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorAqua) );
Hor=Param("Horizontal Position",350,1,1200,1);
Ver=Param("Vertical Position",1,1,1,1);
GfxTextOut("OSMA : "+ NumToStr(osma,1.2) ,Hor , Ver );
GfxTextOut("MOM : "+ NumToStr(Momentum( Haclose, 14 ),1.2) ,Hor , Ver+15 );
_SECTION_END();
 
the small circle - on the plot is the catual bar on which the calc is valid
the arrow is plotted on the completion of the calc bar

so wjen the small circlr is plotted - be rady to get on the trade - may be on open or put some limit values


SubrotoJi ,
How to put Limit Values to our Buy/Sell conditions , pls share an example code for any scrip

Thank u
 

Similar threads