Aiuto per codice intraday non funzionante

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #253187 quote
    Mauro MMauro M
    Participant
    New

    Ho creato questo codice time frime 15 minuti. Dovrebbe comprare ai massimi della candela delle ore 9 se viene superato nelle tre candele successive. Se non entra cancella l’ordine. Ma come vedrete non funziona.  Sulla creazione dei ts intraday faccio schifo lo so da solo.

     

     

    // — Parametri base —

    DEFPARAM CumulateOrders = False

     

    // — Identificazione della candela delle 9:00 —

    IF time = 090000 THEN

    maxCandle9 = high

    barCandle9 = barindex

    ENDIF

     

    // — Condizione di ingresso: massimo superato entro 3 candele successive —

    IF barindex > barCandle9 AND barindex <= barCandle9 + 3 THEN

    IF high > maxCandle9 THEN

    BUY 1 CONTRACT AT MARKET

    // Disattivo la condizione dopo l’acquisto

    barCandle9 = 0

    ENDIF

    ENDIF

    #253191 quote
    JSJS
    Participant
    Master

    Ciao,

    Prova questi:(puoi anche utilizzare un ordine STOP: Buy 1 contract at maxCandle9 STOP)

    DefParam CumulateOrders=False
    
    If OpenTime=090000 then
    maxCandle9=High
    barCandle9=BarIndex
    EndIf
    
    If BarIndex-barCandle9<=3 then
    If Close>maxCandle9 then
    Buy 1 contract at Market
    EndIf
    EndIf
    
    GraphOnPrice maxCandle9
    Iván González thanked this post
    Scherm­afbeelding-2025-11-02-om-10.59.44.png Scherm­afbeelding-2025-11-02-om-10.59.44.png
    #253195 quote
    Mauro MMauro M
    Participant
    New

    grazie dell’aiuto ma non entra al massimo della candela delle ore 9

    #253196 quote
    Mauro MMauro M
    Participant
    New

    ci entra ma dopo la terza candela . io vorrei che alla prima candela che supera il max delle ore 9 lui entrasse, e per fare questo massimo devono susseguirsi tre candele. Esempio grafico orario . candela delle 10 non supera il massimo delle ore 9 si aspetta la candela delle 11 e se neanche questa lo supera si aspetta la candela delle 12 se neanche questa lo supera il segnale si cancella.

    #253197 quote
    JSJS
    Participant
    Master

    Ciò è dovuto all’ordine “Mercato”, che apre una posizione sull'”Apertura” del bar successivo…

    Puoi utilizzare un ordine “Stop” invece dell’ordine “Mercato”…

    DefParam CumulateOrders=False
    
    If OpenTime=090000 then
    maxCandle9=High
    barCandle9=BarIndex
    EndIf
    
    If BarIndex-barCandle9<=3 then
    //If Close>maxCandle9 then
    //Buy 1 contract at Market
    Buy 1 contract at maxCandle9 Stop
    //EndIf
    EndIf
    
    GraphOnPrice maxCandle9
    Iván González thanked this post
    Scherm­afbeelding-2025-11-02-om-14.00.09.png Scherm­afbeelding-2025-11-02-om-14.00.09.png
    #253201 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    @Mauro M

    come indicato nelle regole basilari evidenziate qui sotto in giallo:

    Dai un titolo significativo al tuo argomento. Descrivi la tua domanda o l’oggetto nel titolo. Non utilizzare titoli privi di significato come “Aiuto per la codifica”. Grazie 🙂

    L’ho variato io.

    #253203 quote
    Mauro MMauro M
    Participant
    New

    Grazie  mille funziona, sei stato gentilissimo.

    Scusami Roberto.

    JS and robertogozzi thanked this post
Viewing 7 posts - 1 through 7 (of 7 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

Aiuto per codice intraday non funzionante


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Mauro M @mauro-m Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by Mauro MMauro M
10 months, 2 weeks ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/02/2025
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...