Yeah, I got the same message, I was using a strategy on 30-minute chart with my code dealing with 1-hour and 1-minute TFs!
I had to switch to 1-minute (all TIMEFRAMES referenced within the code MUST be multiple of the one on the chart, so the chart TF has to be equal or less than the smallest one in the code).
So far MTF is working out just great.
Here is the results of a very simple long only strategy with entries and exits based purely on RSI across four time frames and with a simple bull market/bear market filter on the daily timeframe. It is traded on the DJI 5 minute chart. I like the fact that it has been consistently profitable in both trending and the recent volatile choppy markets.
Has anyone else got any good examples of MTF working well ?
[attachment file=76316]
nice work! i am working on a TF model – but still working haha
entries and exits based purely on RSI across four time frames and with a simple bull market/bear market filter on the daily timeframe. It is traded on the DJI 5 minute chart.
You big tease … let’s see what you’ve got! 🙂 🙂
I just tried to code something using a default chart time frame of 10 minutes with 15 minute, 30 minute, 1 hour and daily time frames and I got this error:
[attachment file=76322]
I’m guessing it is because 10 does not divide into fifteen. I’m not sure that I understand why we are limited to time frames that can be divided into each other but it will be something that we have to be aware of when coming up with our strategy ideas.
You big tease … let’s see what you’ve got!
You show me yours and I might show you mine. Anyhow it is all in the strategy description – you just need to use the right numbers and fill in the bits of code in between them to get the same strategy.
15 is not a multiple of 10, try 5 instead, so 5-15-30….
15 is not a multiple of 10, try 5 instead, so 5-15-30….
Yes I understand the maths! I just don’t understand the logic behind the reason.
u dont have to understand… 😀 its new and not perfect 😀 but i had the same problem first so thats why i changed like roberto said. better than nothing and better than without timeframe 🙂
Not been following progress or read anything re Multi-TF as I kinda thought the coding would be complex! 🙂
Anyway jumped straight in … seems intuitive and easier / more straightforward code to get a decent result with Multi than single TF?
Attached is only 12 lines of code that even I can understand! 🙂
Just a question. I have an IG account (real account), but i can switch on demo account and run Prorealtime on demo. I did it and tried to run a MTF code but it did not work…
Do you know how i can have access to MTF backtest ? Is it working in France ?
tried to run a MTF code but it did not work…
If you post your code on here then I would run it for you to see what I get and if I can see any issues in the code.
Seems to me the easiest / quickest way to find out if it’s your code or your Platform?
I did not have the opportunity to test this code as i do not have access to MTF with IG now.
But, this is a piece of code i would try to improve when I can.
It is only buy at the moment. You can make it run on EURUSD M1 to test it.. maybe it will be very bad i do not know.
The idea in the future would be to improve the MM and the exit method (Entry in M1 but manage a breakeven in M1 + exit in M5 or M15…).
// Définition
DEFPARAM CumulateOrders = False
DEFPARAM FLATBEFORE = 090000
DEFPARAM FLATAFTER = 120000
TIMEFRAME(5 minutes)
haclose=(open+close+low+high)/4
haopen=(haopen[1]+haclose[1])/2
sto = Stochastic[5,3](close)
bull5=(haclose>haopen) and (sto>sto[1]) and (sto<80)
TIMEFRAME(15 minutes)
haclose=(open+close+low+high)/4
haopen=(haopen[1]+haclose[1])/2
sto = Stochastic[5,3](close)
bull15=(haclose>haopen) and (sto>sto[1]) and (sto<80)
TIMEFRAME(default)
haclose=(open+close+low+high)/4
haopen=(haopen[1]+haclose[1])/2
sto = Stochastic[5,3](close)
Average=Average[3]
Signal= (haclose>haopen) and (sto>sto[1]) and (sto<80) and sto CROSSES OVER average)
if bull5 and bull15 and signal then
buy at market
endif
// Close position
TIMEFRAME(default)
sto = Stochastic[5,3](close)
IF sto CROSSES OVER 80 THEN
SELL AT MARKET
ENDIF
// Stops
SET STOP pLOSS 15