|
Price action based system
#435965
01/16/14 15:52
01/16/14 15:52
|
Joined: Jul 2013
Posts: 75
royal
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2013
Posts: 75
|
Hi guys! I am trying to implement the strategy presented on today's Mechanical Forex blog: Price action system This is the code I got so far:
// http://mechanicalforex.com/2014/01/global-trading-building-a-forex-price-action-based-system-for-the-4-majors.html
function run()
{
StartDate = 2002;
BarPeriod = 1440;
LookBack = 200;
NumWFOCycles = 10; // activate WFO, 10 cycles
while(asset(loop("EUR/USD", "GBP/USD", "USD/JPY", "USD/CHF"))){
if(priceClose(9) > priceClose(10) && priceOpen(158) > priceLow(130) && priceClose(156) > priceClose(173))
reverseLong(1);
Stop = 1.8*ATR(20);
if(priceClose(9) < priceClose(10) && priceOpen(158) < priceLow(130) && priceClose(156) < priceClose(173))
reverseShort(1);
Stop = 1.8*ATR(20);
}
}
For completing the code I need some advice how to implement the following: Note that the system reverses trades on opposite signals so if a system is within a long and it receives a short signal it will close the long and go short. Another important factor is that the system uses a 180% of the 20-ATR stop-loss which is updated whenever a signal in the same direction is received (for those of you with the doubt, adding new positions on new signals in the same direction increases draw downs significantly, much more than it does profits). Another important aspect – if you want to reproduce my tests – is that my data is refactored within the F4 framework to be GMT +1/+2, the refactoring also makes all Monday candles start at 4 and all Friday candles end at 19 (GMT +1/+2 time). The system seems to be quite interesting in long term trading. (Especially with some additions like OptimalF and equity curve trading, etc.) So thanks in advance for any tips 
|
|
|
Re: Price action based system
[Re: jcl]
#436028
01/17/14 10:44
01/17/14 10:44
|
Joined: Jul 2013
Posts: 75
royal
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2013
Posts: 75
|
In the comments he's saying that The system was mined on 1993-2003 data, 2003 to 2013 is out-of-sample. But you are right, I also wondered what's the approach in his logic.
|
|
|
Re: Price action based system
[Re: jcl]
#436032
01/17/14 13:03
01/17/14 13:03
|
Joined: Jan 2014
Posts: 2
danielfp
Guest
|
Guest
Joined: Jan 2014
Posts: 2
|
Hi Guys,
The system was picked up as the top performer from an absolute profit perspective in the 1993-2003 period, there was no data-snooping in the system's selection (otherwise the 2003-2013 period would in-sample as jcl says). It is also worth mentioning that I ended up with 5 systems (R2 > 0.95 in the in-sample region) and all had similar OS results nonetheless.
It is also worth mentioning that the unlikeliness of a correlation does not automatically mean it's spurious. There could be a lag 1000 system that is causally correlated with price action. I will be posting an article about this soon, you'll see that having lag 0 or lag X systems doesn't mean that you cannot be OS successful. There are most probably valid correlations with all sorts of lags , only that those with lag 0 (using data up to the last moment) are the most intuitive. There is no proof that a system with a lag beyond the last closed bar cannot be profitable in the OS.
Thanks a lot for reading my blog guys :o)
Best Regards,
Daniel
PS: As I said on the post I also wouldn't trade this system, as it's statistical characteristics are still quite bad. I would have to improve it a lot before even considering it for live trading.
Last edited by danielfp; 01/17/14 13:05.
|
|
|
Re: Price action based system
[Re: jcl]
#436038
01/17/14 14:40
01/17/14 14:40
|
Joined: Jan 2014
Posts: 2
danielfp
Guest
|
Guest
Joined: Jan 2014
Posts: 2
|
Hi Jcl, I just posted it if you want to take a look here, note that this is a preliminary analysis on EUR/USD daily data. It shows that while small lag systems do have an advantage regarding a probability of OS success, long lag correlations do not constitute a certainty of OS failure (this could be unique to the EUR/USD, I don't know yet). I also mention how you could potentially have a long term lag that has a causal relationship. For example if a non-speculative market player makes systematic moves across fixed time intervals. I will run a more complete analysis on this matter and will publish it in a few weeks when it's ready (when I have more data around different symbols and larger numbers across larger/smaller lags). A more complete analysis is needed to really draw some conclusions. For the global trading strategy, I would indeed be inclined to examine it further. Perhaps this persistent long-lag and long-lived correlation across several symbols is a consequence of something else, that can be expressed in a less odd manner. Thanks again for visiting my website :o) Best Regards, Daniel
|
|
|
|