Different time frames required on code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #103314 quote
    Slowlyslowly
    Participant
    Average

    Hi

     

    Is it possible to have 3 conditions to be met to activate a trade on 3 different time frames ?

    Example would be 4hr time frame price is < EMA 20

    but must also have 1hr Time frame price is < EMA 20

    Also 15 minute time frame price is <EMA 9

     

    Then SELLSHORT X CONTRACTS AT MARKET

     

    Many thanks for your assistance .

    #103320 quote
    robertogozzi
    Moderator
    Master
    TIMEFRAME(4 hour,updateonclose)
    c1 = close < average[20,1](close)
    //
    TIMEFRAME(1 hour,updateonclose)
    c2 = close < average[20,1](close)
    //
    TIMEFRAME(15 minute,updateonclose)
    c3 = close < average[9,1](close)
    //
    TIMEFRAME(default)                          //can be 15 minutes or lower (but all greater TF's must be a multiple of it)
    IF c1 AND c2 AND c3 AND Not OnMarket THEN
       SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    There you go.

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

Different time frames required on code


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
6 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/24/2019
Status: Active
Attachments: No files
Logo Logo
Loading...