Simple Coding Help - No Promise.

Hello

Sorry was out of station and at a place with no net or phone coverage . . . :D



Happy Singh

Can you please make an exploration to scan all types of Doji's and Pin Bar's preferably on any time frame ?

Amit

Code:
Filter = abs(O-C) / (H-L)  < Param("O2C % of Range", 0.3,0.05,0.5,0.05);


Uploaded with ImageShack.us

Can somebody help me in writing a scan ?
As shown in the chart, the area marked with rectangle, almost all the EMA's which can be seen in title are very much near.
In this case, 20 EMA = 5961.28
15 min 20 EMA = 5959.14
30 min 20 EMA = 5961.11
Hourly 20 EMA = 5958.77

So I want to scan stocks in my watch list meeting the above condition and want to run this scan every 5 minutes.

Thanks for the help in advance.

Manoj
Code:
P = Param("Points Difference", 5,0.5,25,0.5);
Filter = abs(MA1-MA_15)   < P AND abs(MA1-MA_30)   < P AND abs(MA1-MA_Hr) < P AND 
         abs(MA_15-MA_30) < P AND abs(MA_15-MA_Hr) < P AND abs(MA_30-MA_Hr) < P;

:) Happy
 
SetChartOptions(0,chartShowArrows|chartShowDates);
Color = SM_TrendBars(ColorRGB(0,191,255), colorRed,colorGrey50);
Plot( C, "Price", Color, styleCandle | styleThick );
j=SM_WP();
SL = SM_NW(j,1,2);

P1 = Param("Conversion Period", 9, 2, 200, 1, 0);
C1 = ParamColor("Conversion Color", colorBlue);
CL = (HHV(H,P1)+LLV(L,P1))/2;

P2 = Param("Base Period", 26, 2, 200, 1, 0);
C2 = ParamColor("Base Color", colorRed);
BL = (HHV(H,P2)+LLV(L,P2))/2;

C3 = ParamColor("Leading A Color", colorBrightGreen);
LSA = (CL+BL)/2;

P4 = Param("Leading B Span", 52, 2, 200, 1, 0);
C4 = ParamColor("Leading B Color", colorPink);
LSB = (HHV(H,P4)+LLV(L,P4))/2;

P3 = Param("Leading Span Displacement", 26, 2, 200, 1, 0);

P5 = Param("Lagging Displacement", -26, 2, 200, 1, 0);
C5 = ParamColor("Lagging Color", colorGreen);

Plot(CL,"Tenkan-sen (Conversion Line)", C1, styleLine);
Plot(BL, "Kijun-sen (Base Line)", C2, styleLine);
Plot(LSA, "Senkou Span A (Leading Span A)", C3, styleLine, 0, 0, P3);
Plot(LSB, "Senkou Span B (Leading Span B)", C4, styleLine, 0, 0, P3);
Plot(C, "Chikou Span (Lagging Span)", C5, styleLine, 0, 0, P5);
PlotOHLC (LSA,LSA,LSB,LSB,"Cloud",IIf(LSA>LSB,ColorBlend(C3, colorWhite, 0.6),
ColorBlend(C4,colorWhite, 0.4)),styleCloud, 0, 0, P3);




happy or pratap can u pls put buy & sell condition as under:-
1buy if price is above cloud &
2cl(tankensen) crosses bl(kijun sen) & pointing upwards
vice versa for sell
will be of immense help.

Code:
Buy  = Cross(CL,BL) AND C > LSA AND C > LSB;// AND LSA > ref(LSA,-1) AND LSB > ref(LSB,-1);
Sell = Cross(BL,CL) AND C < LSA AND C < LSB;// AND LSA < ref(LSA,-1) AND LSB < ref(LSB,-1);
PlotShapes(Buy+2*Sell,colorBrightGreen,0,IIf(Buy,L,H),-30);
 
Last edited:
Hello

Due to new commitments on my part and lack of time, I may not able to respond to all the queries posted here . . .

To avoid people getting annoyed, I request the moderators / Admin to please close this thread

It was fun trying to help in a small way.

When free will try to give AFL coding inputs to the queries on various threads but please start your own thread with your new queries.



:) Happy
 
no please happy singh
let this thread remain open it will be useful as as many requests will be in one single thread
no need to go to other threads
any way thanks for all the help you provided choice is still urs just gave an opinion
Hello Gandhar

No problems even with that, either way . . . . I am Happy :)

I can understand when a person is facing a problem and posts here expecting a solution, would feel the frustration if they get no reply even after repeated polite reminders.

Just to avoid putting them in such a situation I have requested to close this thread, and not due to irritation or any that sort of feeling towards anyone.


I wish everyone finds the True Happiness, they are looking for :thumb:

:) Happy
 
Jaate Jaate hame help karte jao please bhai.

The condition would be to buy all greem bars highs plus a filter and short all red bar lows with a filter
Define Green/Red Bars . . .or is it just Close < Open and Close < Open
 
Last edited:
You are right.

I want to see how much and what kind of movement is there in this system.

I am planning a filter of 2 points on the low of red bar for shorts and 2 points on the high of the green bar for longs.

Your help is HIGHLY appreciated.
Code:
Buffer = Param("Filter",2,0,100,0.5);
Buy  = Ref(C,-1) > Ref(O,-1) AND H > Ref(H,-1) + Buffer;
Sell = Ref(C,-1) < Ref(O,-1) AND L < Ref(L,-1) - Buffer;
Buy = ExRem(Buy,Sell); Sell= ExRem(Sell,Buy);
Short = Sell; Cover = Buy;
PlotShapes(Buy+2*Sell,colorWhite,0,IIf(Buy,L,H),-30);
 
:clapping::clapping::clapping:

Thank you so much my friend.

It took you a few minutes, but it would have taken me more than a lifetime.

Thank you.

Now I just need your suggestion as to how to backtest this in amibroker on 5 minutes setting.
Drag drop // or copy/paste this code onto a chart with Price, then use the analysis feature of AB for back testing . . .

refer to the manual for more :thumb:
 

amitrandive

Well-Known Member
Hello

Sorry was out of station and at a place with no net or phone coverage . . . :D






Code:
Filter = abs(O-C) / (H-L)  < Param("O2C % of Range", 0.3,0.05,0.5,0.05);


Code:
P = Param("Points Difference", 5,0.5,25,0.5);
Filter = abs(MA1-MA_15)   < P AND abs(MA1-MA_30)   < P AND abs(MA1-MA_Hr) < P AND 
         abs(MA_15-MA_30) < P AND abs(MA_15-MA_Hr) < P AND abs(MA_30-MA_Hr) < P;

:) Happy
Thanks Happy Singh :clap:
 

Similar threads