Two candle strategy

#35
Code:
//Karthik's 2 Bar Strat
Bull	= 	Ref(C,-1) > Ref(O,-1) AND C > O AND H > Ref(H,-1) AND L > (Ref(H,-1)+Ref(L,-1))/2;
Bear	= 	Ref(C,-1) < Ref(O,-1) AND C < O AND L < Ref(L,-1) AND H < (Ref(H,-1)+Ref(L,-1))/2;
Filter =  Bull OR Bear;

PlotShapes(7*Ref(Bull,-1),colorBlue,0, L);
PlotShapes(8*Ref(Bear,-1),colorRed, 0, H);

Hi = HHV(H,2);	Lo = LLV(L,2);	SL = (Hi+Lo)/2;
LT = 2*Hi-SL; 	ST = 2*Lo-SL;

if( SelectedValue(Bull)) {
	Plot(SelectedValue(Hi),"Long BO",colorBlue,styleDashed,0,0,9);
	Plot(SelectedValue(LT),"Long Target",colorBlueGrey,styleDashed,0,0,9);
	Plot(SelectedValue(SL),"Stop Loss",colorBrightGreen,styleDashed,0,0,9); }
if( SelectedValue(Bear)) {
	Plot(SelectedValue(Lo),"Short BO",colorRed,styleDashed,0,0,9);
	Plot(SelectedValue(ST),"Short Target",colorLime,styleDashed,0,0,9);
	Plot(SelectedValue(SL),"Stop Loss",colorBrightGreen,styleDashed,0,0,9); }
Version 2, with more visual aids for trading the chart . . . select the 2nd bar on the setup and the Entry/Exit & SL lines will be shown. ..

Cheers

:) Happy
 
#37
ok..i will test when i get time and let you know the results...
Hi

I believe its not going to be so straight forward :D

The rules are good for visual trading, but if you want to automate then need to add loads of exceptions . . .

for e.g what do you do when the rules are obeyed but the bars are tiny . . . tincy wincy ones . . . or one of them is a WRB . . .
many such things like if it is first part on the rally/decline or exhaustion phase . . .
when trading visually all these things are intuitively eliminated :thumb:

Anyway looking forward to your tests

Cheers

:) happy
 

Vertigo_1985

Well-Known Member
#39
Hi

I believe its not going to be so straight forward :D

The rules are good for visual trading, but if you want to automate then need to add loads of exceptions . . .

for e.g what do you do when the rules are obeyed but the bars are tiny . . . tincy wincy ones . . . or one of them is a WRB . . .
many such things like if it is first part on the rally/decline or exhaustion phase . . .
when trading visually all these things are intuitively eliminated :thumb:

Anyway looking forward to your tests

Cheers

:) happy
i know a lot of filters would be needed but he hasn't mentioned any yet..maybe he can now...
 

Similar threads