sintassi funzione Max

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #188410 quote
    eningi
    Participant
    New

    Ho scritto una linea di codice come questa:

    massimo = Max (high[4],high[5],high[6])

    però c’è un errore nella sintassi. In cosa sbaglio?

    #188412 quote
    robertogozzi
    Moderator
    Master

    MAX(valore1,valore2) richiede solo DUE valori. Per usarne di più devi annidare più volte MAX() all’interno di se stesso:

    massimo = Max(high[4],Max(high[5],high[6]))

    Puoi anche metterne di più (con troppi è più facile commettere errori logici, ovviamente):

    massimo = Max(high[4],Max(high[5],Max(high[6],high[7])))

    come puoi notare, alla fine ci sono tante parentesi tonde di chiusura quante sono le volte che hai usato MAX(), nel primo esempio 2 volte, quindi 2 tonde, mentre nel successivo MAX() appare 3 volte, quindi la riga termina con 3 tonde.

    eningi thanked this post
    #188420 quote
    eningi
    Participant
    New

    Grazie mille

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

sintassi funzione Max


ProScreener: Scansione Mercati & Screener

New Reply
Author
author-avatar
eningi @eningi Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by eningi
4 years ago.

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 02/17/2022
Status: Active
Attachments: No files
Logo Logo
Loading...