Calcolare nr di barre tra massimo e minimo in un range massimo di barre

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #72112 quote
    sct3
    Participant
    New

    Ciao, Sto cercando un aiuto per definire una variabile “NUMEROBARRETRAMAXEMIN”  che identifica il numero di barre che intercorrono tra un massimo e un minimo e questo massimo e minimo si realizzano all’interno di un range di 90 barre

    MassimoX = Highest[90](High)
    MinimoX = Lowest[90](Low)
    VarX = (MassimoX-MinimoX)/(Minimo)*100

    NUMEROBARRETRAMAXEMIN ????

     

    Ringrazio quanti possono aiutarmi

    #72117 quote
    robertogozzi
    Moderator
    Master

    Non c’ una funzione specifica, devi usare un ciclo FOR…NRXT.

    #72127 quote
    sct3
    Participant
    New

    Grazie Roberto per la tua risposta

    questa variabile mi serve all’interno del proscreener di Prorealtime

    come posso scriverla?

    non sono per nulla avvezzo con il codice

    Io pensavo che avrei dovuto identificare il nr della bar del max a ritroso rispetto all’ultima barra (odierna)

    poi il numero della barra del min sempre a ritroso rispetto all’ultima barra (odierna)

    Fare la differenza tra i 2 numeri trovati  per ottenere quante barre ci sono tra il Max e il Min

    #72157 quote
    Nicolas
    Keymaster
    Master

    Hai ragione sct3, è così che funziona. Ma come fai a sapere quale barra è il prezzo più basso? Lo stesso vale per il bar che ha incontrato il prezzo più alto negli ultimi 90 bar?
    Hai bisogno di un ciclo in passato per identificarli:

    MassimoX = Highest [90] (High) 
    MinimoX = Lowest [90] (Low) 
    
    highbar=0
    lowbar=0
    for i = 0 to 89 do 
     if high[i]=massimox then 
      highbar=barindex[i]
     endif
     if low[i]=minimox then 
      lowbar=barindex[i]
     endif
     if lowbar>0 and highbar>0 then 
      break
     endif
    next 
    
    diff = abs(highbar-lowbar)
    #72158 quote
    sct3
    Participant
    New

    Grazie mille Nicolas

    per il preziosissimo contributo.

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

Calcolare nr di barre tra massimo e minimo in un range massimo di barre


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
sct3 @sct3 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by sct3
7 years, 8 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/03/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...