MultiTimeFrame simple conditions

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #89797 quote
    Leo
    Participant
    Veteran

    Hi all,

    I just got an idea. We made a very simple strategy like :

    Close above SMA20 in a downward SMA20 curve, Price above SMA200 in a upward curve ( more or less “mean reversal” strategy)

    ConditionLong00001= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)

    Then this condition we put it in multiple time Frames…

    In means that when that condition in many other Chart, we entry the markets…

    I am not at home already but here is more or less my psehudo code.

    Strategy to be run in 5 min chart

    ConditionLong00001= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(10 minutes,updateonclose)
    ConditionLong00002= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(15 minutes,updateonclose)
    ConditionLong00003= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(20 minutes,updateonclose)
    ConditionLong00004= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(30 minutes,updateonclose)
    ConditionLong00005= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(45 minutes,updateonclose)
    ConditionLong00006= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(60 minutes,updateonclose)
    ConditionLong00007= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(120 minutes,updateonclose)
    ConditionLong00008= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(240 minutes,updateonclose)
    ConditionLong00009= close>average[20](close) and average[20](Close[1])>average[20](Close) and lowest[5](low) > average[200](Close) and average[200](Close[1])<average[200](Close)
    
    timeframe(default)
    
    ConditionLong = ConditionLong00001 + ConditionLong00002 + ConditionLong00003 + ConditionLong00004  + ConditionLong00005  + ConditionLong00006  + ConditionLong00007  + ConditionLong00008  + ConditionLong00009
    
    If ConditionLong  > 2 then
    buy at market 
    endif 
    
    
    #89798 quote
    Leo
    Participant
    Veteran

    Please let me know your thoughs or share possibles new ideas for testing

    thanks

    #89804 quote
    GraHal
    Participant
    Master

    Hahaha looks good, I like the thinking behind it all.

    I was excited to try but it shows up a limit nobody has mentioned as I recall?

    See attached

    Ill tweak / cut it down and report back.

    Leo20.jpg Leo20.jpg
    #89809 quote
    robertogozzi
    Moderator
    Master

    I didn’t know there’s a limit. Good to know!

    #89811 quote
    Leo
    Participant
    Veteran

    Haha. We are beyond the limits!

    And where is the limit then?

    #89818 quote
    robertogozzi
    Moderator
    Master

    Just remove a TIMEFRAME at a time until no erros is reported, let us know!

    #89822 quote
    GraHal
    Participant
    Master

    I’ve got attached so far which I’d be more happy with if it works like that in Forward Test! 🙂

    Spread = 4

    Leo21.jpg Leo21.jpg Leo22.jpg Leo22.jpg
    #89825 quote
    Vonasi
    Moderator
    Master

    Five! It says it in the error message!

    #89826 quote
    GraHal
    Participant
    Master

    Just remove a TIMEFRAME at a time until no erros is reported, let us know!

    Ha I dd that but forgot to keep a note, but anyway the Limit is 5 TF’s (+ default) as it says so on the error message??

    #89828 quote
    robertogozzi
    Moderator
    Master

    AhAhAh…. fa kin soo pa!

    I need to contact my optician!

    #89831 quote
    Vonasi
    Moderator
    Master

    fa kin soo pa!

    I didn’t know you could speak Chinese!

    robertogozzi and GraHal thanked this post
    #89833 quote
    Leo
    Participant
    Veteran

    Looks awesome!

    #89836 quote
    robertogozzi
    Moderator
    Master

    The limit is 5 TF’s (+ default one), but…

    • writing them with AND without UPDATEONCLOSE counts as 1
    • writing multiple times the same TF in the strategy counts AS 1

    This works finely:

    TIMEFRAME(default)
    c01 = average[200]
    TIMEFRAME(128 hours)                  //TF 1
    c02 = average[200]
    TIMEFRAME(128 hours,updateonclose)
    c03 = average[200]
    TIMEFRAME(32 hours)                   //TF 2
    c04 = average[200]
    TIMEFRAME(32 hours,updateonclose)
    c05 = average[200]
    c06 = average[200]
    TIMEFRAME(128 hours,updateonclose)             //TF 1
    c07 = average[200]
    c08 = average[200]
    c09 = average[200]
    TIMEFRAME(120 minutes)                //TF 3
    c10 = average[200]
    TIMEFRAME(60 minutes,updateonclose)   //TF 4
    c11 = average[200]
    TIMEFRAME(60 minutes)
    c12 = average[200]
    TIMEFRAME(2 minutes,updateonclose)   //TF 5
    c13 = average[200]
    TIMEFRAME(2 minutes)
    c14 = average[200]
    c15 = average[200]
    buy AT -close limit
    TIMEFRAME(default)
    x=c01 +c02 +c03 +c04 +c05 +c06 +c07 +c08 +c09 +c10 +c11 +c12 +c13 +c14 +c15
    IF x THEN
    ENDIF
    #89838 quote
    Leo
    Participant
    Veteran

    Then what will be clever?

    Small periods as default and longer periods as UpdateOnClose

    Or the other way around?

    #89843 quote
    robertogozzi
    Moderator
    Master

    Sorry , there’s must have been a misunderstanding. The limit is till 5 TF’s, what I meant was that you can write the TIMEFRAME keyword 10 or more times, with/without UPDATEONCLOSE and it will be valid, but if you write 6 different TF’s, no matter whether using default or updateonclose, you are beyond limits.

    The limit is the number of DIFFERENT TF’s you want to use, not how many times you use the TIMEFRAME keyword, thus an answer to your last post is not a way to overcome the limit.

Viewing 15 posts - 1 through 15 (of 33 total)
  • You must be logged in to reply to this topic.

MultiTimeFrame simple conditions


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Leo @leito Participant
Summary

This topic contains 32 replies,
has 5 voices, and was last updated by jebus89
7 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/28/2019
Status: Active
Attachments: 11 files
Logo Logo
Loading...