Condizione Time Frame Differente

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #246719 quote
    MICH
    Participant
    Junior

    Ciao a tutti,

    Sono in difficoltà a inserire un codice che apra una posizione con una condizione che è verificata su un time frame diverso da quello sul quale sto operando. Ad esempio buy se:

    • RSI(14) > 30 nel time frame 5 min (che è il time frame nel quale sto scrivendo il codice)
    • ADX (14) > 20 sul time frame 30 min

    Mi potete per favore aiutare?

    #246743 quote
    JS
    Participant
    Senior
    Hi, Try this one:
    DefParam CumulateOrders=False
    
    TimeFrame(30 minutes, UpdateOnClose)
    xADX=ADX[14]
    
    TimeFrame(Default) //5 minutes
    xRSI=RSI[14]
    
    If xADX>20 and xRSI>30 then
    Buy 1 contract at Market
    EndIf
    
    Graph xADX
    Graph xRSI
    robertogozzi and Iván González thanked this post
    Scherm­afbeelding-2025-05-03-om-12.46.53.png Scherm­afbeelding-2025-05-03-om-12.46.53.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Condizione Time Frame Differente


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
MICH @mich Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JS
10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/02/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...