Condizione Time Frame Differente

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #246719 quote
    MICHMICH
    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
    JSJS
    Participant
    Master
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 JSJS
1 year, 4 months ago.

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