Errore su costante Dlow

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #49470 quote
    maximus78maximus78
    Participant
    Senior

    Buongiorno a tutti, stavo provando il codice che trova l’higher high e higher low giornaliero in intraday utilizzando gli esempi in documentation.

    https://www.prorealcode.com/documentation/category/constants/

    Ma se per il Newhighest trova correttamente il massimo, per il Newlowest  da sempre valore 0.

    Volevo segnalare questo errore e chiedere se si può correggere.

    grazie

    Massimo

    //Looking the highest high of the last 10 bars
    Newhighest=0
    FOR a = 0 TO 10 DO
           IF DHigh(a)>Newhighest THEN 
                Newhighest = DHigh(a)   
           ENDIF
    NEXT
    
    RETURN Newhighest
    
    //Looking the lowest low of the last 10 bars
    Newlowest=0
    FOR a = 0 TO 10 DO
           IF DLow(a)<Newlowest THEN 
                Newlowest = DLow(a)   
           ENDIF
    NEXT
    
    RETURN Newlowest
    #49507 quote
    NicolasNicolas
    Keymaster
    Legend

    Grazie per averlo indicato, è davvero un errore stupido, il prezzo non può mai essere inferiore a 0 e quindi il valore del minimo sarà sempre uguale a 0. Qui è il codice corretto:

    //Looking the lowest low of the last 10 bars
    Newlowest=0
    FOR a = 0 TO 10 DO
           IF DLow(a)<Newlowest or Newlowest=0 THEN 
                Newlowest = DLow(a)   
           ENDIF
    NEXT
     
    RETURN Newlowest
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

Errore su costante Dlow


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
maximus78 @maximus78 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
8 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 10/16/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...