Need help to code a strategy .

#11
Don't think there is any merit in this logic (above 9 rules as not read the link).
Interested in using volume can also try VSA, or Market Profile

BTW, the AFL for the above 9 rules is v easy to code

Here goes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("GUPTAJI KA SYSTEM");
STD_Vol = MA(V,240); //Aprox 1 year average on daily chart
STD_Prc = MA(C,240); //Can change the num 240 as required
Hi_Vol = V >= STD_Vol * 3; // V 3 times normal
Lo_Vol = V <= STD_Vol / 2; // V 1/2 normal
Hi_Prc = C >= STD_Prc * 1.20; // 20% more
Lo_Prc = C <= STD_Prc * 0.85; // 15% less
Md_Vol = V > STD_Vol*0.95 AND V <  STD_Vol*1.05; // 5% band for medium values
Md_Prc = C > STD_Prc*0.95 AND C <  STD_Prc*1.05;
//1: If [volume is low] and [price is low] then Buy....
//4: If [volume is low] and [price is medium] then Buy..
//8: If [volume is high] and [price is low] then Buy...
Buy  = (Lo_Vol AND Lo_Prc) OR (Lo_Vol AND  Md_Prc) OR (Hi_Vol AND Lo_Prc); 
Sell = (Hi_Vol AND Hi_Prc) OR (Lo_Vol AND  Hi_Prc) OR (Md_Vol AND Hi_Prc);
//3: if [Volume is High] AND [price is High] then Sell...
//5: if [Volume is Low] AND [price is High] then Sell.....
//7: if [Volume is medium] AND [price is High] then Sell....
Hold_It = "Don't do no nothing ;)";
//2: if [Volume is medium] AND [price is medium] then Hold...
//6: if [Volume is medium] AND [price is Low] then Hold....
//9: if [Volume is High] AND [price is medium] then Hold....
Buy  = ExRem(Buy,Sell);    Sell = ExRem(Sell,Buy); 
PlotShapes(Buy+Sell*2,colorRed,0,IIf(Buy,L,H));
Plot(STD_Prc,"STD_Prc",colorBlueGrey);
Plot(STD_Vol,"STD_Vol",colorLightGrey, styleThick | styleOwnScale,0,HighestVisibleValue(V)*2);
Plot(IIf(V>0,V,Null), "Volume", IIf(Hi_Vol, colorRed, IIf(Lo_Vol, colorBlue, colorLightGrey)), styleThick | styleHistogram | styleOwnScale,0,HighestVisibleValue(V)*2);
_SECTION_END();
I cant see any Buy sell Arrow
 

johnnypareek

Well-Known Member
#13
Don't think there is any merit in this logic (above 9 rules as not read the link).
Interested in using volume can also try VSA, or Market Profile

BTW, the AFL for the above 9 rules is v easy to code

Here goes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("GUPTAJI KA SYSTEM");
STD_Vol = MA(V,240); //Aprox 1 year average on daily chart
STD_Prc = MA(C,240); //Can change the num 240 as required
Hi_Vol = V >= STD_Vol * 3; // V 3 times normal
Lo_Vol = V <= STD_Vol / 2; // V 1/2 normal
Hi_Prc = C >= STD_Prc * 1.20; // 20% more
Lo_Prc = C <= STD_Prc * 0.85; // 15% less
Md_Vol = V > STD_Vol*0.95 AND V <  STD_Vol*1.05; // 5% band for medium values
Md_Prc = C > STD_Prc*0.95 AND C <  STD_Prc*1.05;
//1: If [volume is low] and [price is low] then Buy....
//4: If [volume is low] and [price is medium] then Buy..
//8: If [volume is high] and [price is low] then Buy...
Buy  = (Lo_Vol AND Lo_Prc) OR (Lo_Vol AND  Md_Prc) OR (Hi_Vol AND Lo_Prc); 
Sell = (Hi_Vol AND Hi_Prc) OR (Lo_Vol AND  Hi_Prc) OR (Md_Vol AND Hi_Prc);
//3: if [Volume is High] AND [price is High] then Sell...
//5: if [Volume is Low] AND [price is High] then Sell.....
//7: if [Volume is medium] AND [price is High] then Sell....
Hold_It = "Don't do no nothing ;)";
//2: if [Volume is medium] AND [price is medium] then Hold...
//6: if [Volume is medium] AND [price is Low] then Hold....
//9: if [Volume is High] AND [price is medium] then Hold....
Buy  = ExRem(Buy,Sell);    Sell = ExRem(Sell,Buy); 
PlotShapes(Buy+Sell*2,colorRed,0,IIf(Buy,L,H));
Plot(STD_Prc,"STD_Prc",colorBlueGrey);
Plot(STD_Vol,"STD_Vol",colorLightGrey, styleThick | styleOwnScale,0,HighestVisibleValue(V)*2);
Plot(IIf(V>0,V,Null), "Volume", IIf(Hi_Vol, colorRed, IIf(Lo_Vol, colorBlue, colorLightGrey)), styleThick | styleHistogram | styleOwnScale,0,HighestVisibleValue(V)*2);
_SECTION_END();
best part the afl

HTML:
_SECTION_BEGIN("GUPTAJI KA SYSTEM");
:clapping:
 

guptak03

Well-Known Member
#15
Don't think there is any merit in this logic (above 9 rules as not read the link).
Interested in using volume can also try VSA, or Market Profile

By Happy ji....
.........................................


suggestion taken and working with VSA learning alot from it and learning how mkt mover (SM)do fishing ..:thumb:
 

Similar threads