please help me to code it.

mmca2006

Active Member
#1
I am requesting the AFL experts to help me regarding an AFL which includes following conditions--

Sell = if today the price ( not close ) at any time goes below yesterday's low by 1% i.e supposse yesterday's low is 500 and if today price goes below 495 (500-1% of500), I will sell it.

similarly if today at any time price goes above 1% of yesterday's high , i will buy it.
Thanks in advance.:)
 

hitesh

Active Member
#2
I am requesting the AFL experts to help me regarding an AFL which includes following conditions--

Sell = if today the price ( not close ) at any time goes below yesterday's low by 1% i.e supposse yesterday's low is 500 and if today price goes below 495 (500-1% of500), I will sell it.

similarly if today at any time price goes above 1% of yesterday's high , i will buy it.
Thanks in advance.:)
This will help.
_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();


L1 = Ref(L,-1);
PA = L1 - (L1/100*1);

h1 = Ref(H,-1);
Pb = h1 + (h1/100*1);

Plot(PA,"PA",colorBlue,styleLine);
Plot(Pb,"Pb",colorRed,styleLine);



Buy = H>PB;
Sell = L < PA;


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

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBlue, colorRed ),0, IIf( Buy, Low, High ) );
 

Similar threads