[beta-testing] multi timeframe support for automatic trading, ideas are welcome!

Viewing 15 posts - 91 through 105 (of 288 total)
  • Author
    Posts
  • #76302 quote
    robertogozzi
    Moderator
    Master

    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).

    Andyswede and immo_vienna thanked this post
    #76306 quote
    immo_vienna
    Participant
    Average

    thanks! that was it!

    #76315 quote
    Vonasi
    Moderator
    Master

    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]

    #76319 quote
    immo_vienna
    Participant
    Average

    nice work! i am working on a TF model – but still working haha

    #76320 quote
    GraHal
    Participant
    Master

    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! 🙂 🙂

    #76321 quote
    Vonasi
    Moderator
    Master

    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.

    #76324 quote
    Vonasi
    Moderator
    Master

    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.

    #76326 quote
    robertogozzi
    Moderator
    Master

    15 is not a multiple of 10, try 5 instead, so 5-15-30….

    #76327 quote
    Vonasi
    Moderator
    Master

    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.

    #76332 quote
    immo_vienna
    Participant
    Average

    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 🙂

    #76344 quote
    GraHal
    Participant
    Master

    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! 🙂

    #76348 quote
    Vonasi
    Moderator
    Master

    Attached is only 12 lines of code that even I can understand!

    Now you are teasing….

    #76374 quote
    Sofitech
    Participant
    Master

    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 ?

    #76380 quote
    GraHal
    Participant
    Master

    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?

    #76468 quote
    Sofitech
    Participant
    Master

    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
Viewing 15 posts - 91 through 105 (of 288 total)
  • You must be logged in to reply to this topic.

[beta-testing] multi timeframe support for automatic trading, ideas are welcome!


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Nicolas @nicolas Keymaster
Summary

This topic contains 287 replies,
has 47 voices, and was last updated by Brianoshea
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/19/2018
Status: Active
Attachments: 48 files
Logo Logo
Loading...