5 bar reversal strategy

Posted By: Sundance

5 bar reversal strategy - 08/05/13 09:55

Hiho together,

when i look at the Z strategies i see that the main time frame is 240min. Also those strategies have drawdowns of many weeks where you have no regular income.

I know that strategies based on higher timeframes are more predictable but for a more steady income it would be cool to see a strategy based on lower timeframes as 5 or 15 min.

What do you guys think of this strategy: 5 bar reversal setup ?
Posted By: blaub4r

Re: 5 bar reversal strategy - 08/05/13 13:51

Originally Posted By: Sundance
Hiho together,

when i look at the Z strategies i see that the main time frame is 240min. Also those strategies have drawdowns of many weeks where you have no regular income.

I know that strategies based on higher timeframes are more predictable but for a more steady income it would be cool to see a strategy based on lower timeframes as 5 or 15 min.

What do you guys think of this strategy: 5 bar reversal setup ?




I think it is pretty difficult to find inefficiencies with smaller BarPeriods, that's why all Zorro Strategies have such big BarPeriods.

I'm trying to code a version of the 5 bar strategy and post it later.
Posted By: Sundance

Re: 5 bar reversal strategy - 08/05/13 13:55

Yeah. I think you are right. Those inefficiencies are lost within the random noise you find in lower timeframes...

Thanks for trying to program the strategy. It won't be that easy. Don't underestimate it :-)
Posted By: blaub4r

Re: 5 bar reversal strategy - 08/05/13 14:02

Yeah, I'm not sure what to do if the priceClose() of the reversal bar already exceeds the entry price.
Posted By: Anonymous

Re: 5 bar reversal strategy - 08/05/13 14:05

Originally Posted By: Sundance
Hiho together,

when i look at the Z strategies i see that the main time frame is 240min.


I remember, when I first saw the Zorro project, that fact is the first thing that attracted me to it. Wow, somebody had a courage to market a 4h forex strategy? They must be genuine. wink

Originally Posted By: Sundance
I know that strategies based on higher timeframes are more predictable but for a more steady income it would be cool to see a strategy based on lower timeframes as 5 or 15 min.


Generally, I agree with you, it would be nice to develop at least one lower TF strategy for Zorro. Of course, the big problem is that market it so much more random at those TF. So it won't be easy. From what I read elsewhere, but it's all theoretical, more frequent trading could produce a strategy with a higher Sharpe, which then would allow higher leverage. Of course, it's easier said than done. I'm not even sure atm that winning strategies are possible at the timeframes below approx. 1 hour. Everybody's free to contest that though, but... grin

Originally Posted By: Sundance

What do you guys think of this strategy: 5 bar reversal setup ?


I guess we won't ever know, unless someone steps in, code and backtests it. wink It should be pretty straigthforward in Zorro, though.

Three things:

- it seems to be for the higher TF, also
- it seems overly simple (but that could be improved upon)
- on the first looking, I haven't caught any exit strategy mentioned, so the strategy is incomplete, as is
Posted By: blaub4r

Re: 5 bar reversal strategy - 08/05/13 14:18

function checkEntry()
{
int i;
// check for five negative candles
for (i = 5; i >= 0; i--)
{
if (i == 0)
if (priceClose(i) - priceOpen(i) > 0)
if (priceOpen(1) > priceClose(0))
{
Entry = priceOpen(1);
Stop = priceOpen(0);
TakeProfit = priceOpen(5);
enterLong();
}
if (priceClose(i) - priceOpen(i) >= 0)
break;
}
// check for positive candles
for (i = 5; i >= 0; i--)
{
if (i == 0)
if (priceClose(i) - priceOpen(i) < 0)
if (priceOpen(1) < priceClose(0))
{
Entry = priceOpen(1);
Stop = priceOpen(0);
TakeProfit = priceOpen(5);
enterShort();
}
if (priceClose(i) - priceOpen(i) <= 0)
break;
}
}

function run()
{
set(LOGFILE);
set(HEDGING);
// var *Trend = series(EMA(Price,250));
TimeWait = 5;

checkEntry();
// zoom in a certain date
StartDate = 20081025;
// NumDays = 10;
// plot("Trend",*Trend,0,RED);

PlotWidth = 800;
PlotHeight1 = 320;
}

That's my first result. Though I get a few "invalid Profit Target errors on EUR/USD, so there is probably still something wrong.

It does not seem to have an edge at first glance.
Posted By: Sundance

Re: 5 bar reversal strategy - 08/05/13 14:27

Hi acid,

blaub4r is already into programming .-)

About the Exit strategy i found something on another page. It should be near the last high/low or S/R or whatever makes you fear to stay in the trade :-)


blaub4r: Thanks. wow. Your fast. I just had created my Visio document for me to see where to go :-)

I will take a look on evening and will report back...


Thanks guys. Now back to work :-)
Posted By: Anonymous

Re: 5 bar reversal strategy - 08/05/13 15:17

Originally Posted By: Sundance
Hi acid,

blaub4r is already into programming .-)


Well, with Zorro, that's the only sane approach. Especially with simple strategy like this. Where you can expect tens of forum pages elsewhere, lamenting and tweaking this and that, a real Zorro coder codes and backtests it and either discards it or improves it in the next half an hour or less. wink

Originally Posted By: Sundance

About the Exit strategy i found something on another page. It should be near the last high/low or S/R or whatever makes you fear to stay in the trade :-)


Nah, say it in code. Or be nice to blaub4r. wink
Posted By: Sundance

Re: 5 bar reversal strategy - 08/05/13 17:35

So. As i made my visio document yesterday i had asked me also what TP to take. The SL is not the problem. It should be clear. I thought to give it a 1:1 or 2:1 risk/reward. So i would start with TP = 2*SL. Or just the simple way of trying to optimize this parameter... :-)

I will respond more later...
Posted By: Sundance

Re: 5 bar reversal strategy - 09/19/13 06:51

Just a quick info. I finished programming the 5bar reversal strategy and can say that this strategy is a total failure :-)
It does make some money but not on a stable basis. There are many month of draw down and no consistency in building some profit.
So guys. Forget about it. I will :-)
Posted By: blaub4r

Re: 5 bar reversal strategy - 09/19/13 11:31

It's not like I said this a month before ...
But it's good to have a confirmation laugh
Posted By: Sundance

Re: 5 bar reversal strategy - 09/19/13 11:46

I just did the programming to learn some things :-)
Posted By: Sundance

Re: 5 bar reversal strategy - 09/21/13 20:40

hi. Just one question. I tried to optimize the TrailSlope parameter with the follwoing line:

TrailSlope = optimize(15, 10, 100, 10);

When doing this i get the following error:
BADFREE2: PL

BADFREE2: PLB


After that Zorro doesn't function and must be closed.


Any thoughts?
Posted By: dusktrader

Re: 5 bar reversal strategy - 09/21/13 22:16

I believe that error means you probably need a bigger Lookback value. If you're not setting Lookback, Zorro cannot always set it automatically during an optimize. Usually when I'm not sure I set it to 500. It needs to cover the max required for your highest optimize range (for example if you are optimizing SMA() and the highest value was 100, then I believe you'd need a minimum 100 Lookback value)
Posted By: jcl

Re: 5 bar reversal strategy - 09/22/13 10:21

A too small lookback value would normally give a different error message. But without seeing what you did in your code to get that error, it's only speculation. The first thing to do when you get error messages is looking for mistakes in your code. Optimizing the trail slope alone is obviously not a mistake, so you have to look again.
Posted By: Sundance

Re: 5 bar reversal strategy - 09/22/13 14:31

Okay. I haven't mentioned that without the optimization there is also no error :-)
Posted By: Sundance

Re: 5 bar reversal strategy - 09/22/13 14:35

Back again. Dusktrader you were right. The LookBack value was 80. I set it to 200 and now there is no error :-)

Thanks mate.
© 2024 lite-C Forums