Trading with Multiple Timeframe

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #212526 quote
    mondster
    Participant
    New

    Hi All, I am new here and exploring this software for auto trading. I have a strategy that I look at 10sec, 1m, 3m, 5m and 15m and while all the signal is align i will execute the trade. this is how I do it using eyeball. while i am exploring this i not entire sure if this can be coded if yes anyone any to give me some help please?

    #212528 quote
    Nicolas
    Keymaster
    Master

    Please define the conditions and we will be happy to help.

    Example of a simple strategy that use multiple timeframes:

    timeframe(1 minute)
    a = rsi[14]
    
    timeframe(5 minutes)
    b = average[20]
    
    timeframe(10 seconds)
    if a crosses over 50 and close>b then 
     buy at market 
    endif
    #212530 quote
    mondster
    Participant
    New

    Hi Thanks, sorry i missing out my sample code, I have coded something like this and it was prompting this,

    Error
    AI tmeFarnes used n your code should be multiples of the timeframe used on the chart on which your strategy is applied (the base timeframe)
    For example
    • If you want to mix 15 minute and 10 minute timeframes n your strategy, you should apply the strategy on a 5min chart (because 15 and 10 are multiples of 5).
    • If you want to mix 7 minute and 5 minute  timeframes in your strategy, you should apply the strategy on a 1 minute chart (because 7 and 5 are multiples of 1).

    Sample of the code that i understand from the documentation,

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated

    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

    timeframe(10 seconds,updateonclose)
    indicator1 = MACDSignal[12,26,9](close)
    c1 = (indicator1 > indicator1[1])
    indicator2 = CCI[20]
    c2 = (indicator2 > indicator2[1])

    timeframe(1 minutes,updateonclose)
    indicator3 = MACDSignal[12,26,9](close)
    c3 = (indicator3 > indicator3[1])
    indicator4 = CCI[20]
    c4 = (indicator4 > indicator4[1])

    timeframe(3 minutes,updateonclose)
    indicator5 = MACDSignal[12,26,9](close)
    c5 = (indicator5 > indicator5[1])
    indicator6 = CCI[20]
    c6 = (indicator6 > indicator6[1])

    timeframe(5 minutes,updateonclose)
    indicator7 = MACDSignal[12,26,9](close)
    c7 = (indicator7 > indicator7[1])
    indicator8 = CCI[20]
    c8 = (indicator8 > indicator8[1])

    IF (c1 AND c2 AND c3 AND c4 AND c5 AND c6 AND c7 AND c8) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Stops and targets
    SET STOP pLOSS 20
    SET TARGET pPROFIT 50

    #212540 quote
    JS
    Participant
    Senior

    Hi

    You can use your code with a time frame of 1, 2, 5 and 10 seconds…

    (10 sec is not a multiple of 3, 4, 6, 7, 8, and 9 seconds)

    Nicolas thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Trading with Multiple Timeframe


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
mondster @mondster Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by JS
2 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/30/2023
Status: Active
Attachments: No files
Logo Logo
Loading...