[beta-testing] multi timeframe support for automatic trading, ideas are welcome!
Forums › ProRealTime English forum › ProOrder support › [beta-testing] multi timeframe support for automatic trading, ideas are welcome!
- This topic has 287 replies, 47 voices, and was last updated 4 years ago by Brianoshea.
Tagged: mtf, multitimeframe
-
-
07/22/2018 at 3:23 PM #7647407/24/2018 at 8:31 AM #76568
Only just noticed this Topic again, sorry.
I got it to run after making lots of changes to overcome error messages (most were – you can’t use same variable name under two Timeframes) … use this site to compare your code version to mine.
But the code still doesn’t execute any trades. I reckon you may have too many conditions that are not coincident so no Trades??
I’ll let you know if I get it going later.
Edit / PS
Yeah, I GRAPH Signal and it doesn’t occur at all, more in a few mins! 🙂123456789101112131415161718192021222324252627282930313233343536373839// DéfinitionDEFPARAM CumulateOrders = FalseDEFPARAM FLATBEFORE = 090000DEFPARAM FLATAFTER = 120000TIMEFRAME(default)haclose=(open+close+low+high)/4haopen=(haopen[1]+haclose[1])/2sto = Stochastic[5,3](close)myAverage=Average[3]Signal= (haclose>haopen) and (sto>sto[1]) and (sto<80) and sto CROSSES OVER myaverageTIMEFRAME(5 minutes)haclose5=(open+close+low+high)/4haopen5=(haopen[1]+haclose[1])/2sto5 = Stochastic[5,3](close)bull5=(haclose5>haopen5) and (sto5>sto[1]) and (sto<80)TIMEFRAME(15 minutes)haclose15=(open+close+low+high)/4haopen15=(haopen[1]+haclose[1])/2sto15 = Stochastic[5,3](close)bull15=(haclose15>haopen15) and (sto15>sto[1]) and (sto<80)if bull5 and bull15 and signal thenbuy at marketendif// ClosedafaultTIMEFRAME(default)sto = Stochastic[5,3](close)IF sto CROSSES OVER 80 THENSELL AT MARKETENDIF// StopsSET STOP pLOSS 1507/24/2018 at 9:10 AM #76571Spent a while on it, got it trading now, but overall a losing Strategy (does not get above 0 at any point over 100k bars).
I made loads changes to Signal criteria, even rem’d it out altogether … still no good!
I even reversed Buys to SellShort and Sells to Exitshort but still overall a losing Strategy.
You need to get Multi-TF on your Platform and rethink the Strategy overall or certain parts anyway?
Maybe I am missing a trick somewhere, so please post the code on this Topic if you do it get it profitable and then it closes the loop? 🙂
07/24/2018 at 9:43 AM #76578as i do not have access to MTF with IG now.
@Sofitech … why do you think you do not have access to MTF … we all have it now surely on our Demo accounts??07/24/2018 at 10:40 AM #76588ProOrder should be by tomorrow if updates are going well.. (and still for DEMO ACCOUNTS ONLY).
@Nicolas apols for disturbing your hols 🙂but do you know if MultiTF is activated on Demo ProOrder / Demo Forward Test yet please?
07/25/2018 at 10:09 AM #76680MTF testing seems to be working fine for me at the moment. I have only had one issue so far:
https://www.prorealcode.com/topic/unable-to-use-variable-across-time-frames/
I think it would be good if we could change the value of a variable in any timeframe. If an event occurs on a weekly chart then you might want to set a flag and then if another event happens in a different time frame change the value of that flag. As can be seen in the topic above it is possible to find workarounds but it would give us more coding options if we could alter variable values in any time frame.
07/25/2018 at 1:37 PM #76710you can’t use same variable name under two Timeframes)
Can you / we not get around the restriction by doing what I did in the post quoted … give the variable a unique name for each TF then have a condition (using the unique named variable in that TF) and then use that condition along with other conditions from other TFs in the default TF that the System / Platform is running on?
Hope that makes sense?? 🙂
07/25/2018 at 1:55 PM #76715Yes, it makes sense, take a look at this (lines 41-50 and 60-69) https://www.prorealcode.com/topic/cowabunga-on-dax-with-multiple-time-frames/.
1 user thanked author for this post.
07/25/2018 at 2:09 PM #76717Hope that makes sense??
Yes it makes sense but wouldn’t it be a whole lot easier if we could just modify any variable in any time frame? Not sure how possible this is for PRT to achieve but it would make coding a lot simpler.
07/25/2018 at 2:58 PM #76727I just had this error message:
If I change ‘hourly’ to ‘1 hour’ then the error disappears.
On here:
https://www.prorealcode.com/blog/learning/approach-multi-timeframe-trading-prorealtime/
Nicolas says that ‘hourly’ is OK to use. The code does not flag it up as an error and ‘hourly’ is shown in blue lettering but the strategy won’t run with it.
07/25/2018 at 4:28 PM #7673707/25/2018 at 8:51 PM #76742No I’m not, I hate the heat! my brain switches off and I feel like a zombie! 🙂
I have read Nicolas blog on MTF, but I’m still not sure I understand the difference between using update on close and not using it.
If anybody has an analogy it might help? Vonasi, you’ve done a few good analogies in the past … got any pearls of wisdom for me on this one? 🙂
The superior TF cannot be making any changes to an Indicator except at the close of the superior TF surely? So what is the need for update on close??
Maybe I’ll reread the MTF blog just before bed and let my brain work on it! 🙂
I know I’ll run one of my MTF systems with update on close and without it and check the differences!
Edit / PS
Ha worse results, – £200 with update on close included … see the top equity curve below.
07/25/2018 at 9:08 PM #76744Ha worse results, – £200 with update on close included … see the top equity curve below.
Mmm the System with updateonclose included stays in trades longer while profit decreases … see attached. The left is with and the right is without.
Anybody any comment / thoughts please?
07/25/2018 at 9:15 PM #76747You have to think of it as making a decision once a candle has closed or on the fly while a candle is still forming.
If you have a 1 hour strategy that also looks at a daily candle then with ‘updateonclose’ it will only consider the values of the last closed daily candle and any indicator values etc of that last closed daily candle when it closed. With ‘default’ at the close of every hourly candle it will look and see what the current values are of the currently forming daily candle and use those values.
07/25/2018 at 9:32 PM #76748With ‘default’ at the close of every hourly candle it will look and see what the current values are of the currently forming daily candle and use those values.
I can see that a price candle is continually forming throughout the day, but if an Indicator is running on a Daily TF then how does that (Daily) Indicator form any intraday value if the Indicator code only runs at the close of the Daily candle??
Maybe I’m confusing myself now … doesn’t take much! 🙂
Edit / PS
It’s only since MTF that the Daily Indicator code would run other than at close of the daily bar?? With MTF the Daily Indicator code (or whatever superior TF code?) now runs at the default TF and computes an intra-day Indicator value??
-
AuthorPosts
Find exclusive trading pro-tools on