Ciclo For
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Ciclo For
- This topic has 4 replies, 2 voices, and was last updated 3 years ago by
robertogozzi.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
01/29/2021 at 9:53 PM #159875
Buonasera a tutti!
come posso trascrivere questo codice mediante un più semplice ciclo for?
Prima analizzo i massimi delle ultime 5 candele di tutti i ROC% con periodo compreso tra 1 e 10, e tra questi voglio il massimo valore.
Grazie in anticipo!
Max
1234567891011121314a1=(highest[5](roc[1]))a2=(highest[5](roc[2]))a3=(highest[5](roc[3]))a4=(highest[5](roc[4]))a5=(highest[5](roc[5]))a6=(highest[5](roc[6]))a7=(highest[5](roc[7]))a8=(highest[5](roc[8]))a9=(highest[5](roc[9]))a10=(highest[5](roc[10]))X=max(a1,(max(a2,max(a3,max(a4,max(a5,max(a6,max(a7,max(a8,max(a9,a10))))))))))return X01/29/2021 at 10:01 PM #159876Eccolo:
12345x = 0For i = 1 to 10x = max(x,(highest[5](roc[i])))Nextreturn x01/29/2021 at 11:25 PM #15988001/16/2022 at 5:18 PM #185627Ciao Roberto, scusa mi riallaccio al codice che avevi scritto sopra…volevo chiederti, come faccio ad implementare il codice nel seguente modo sempre trovando il valore maggiore dei roc, ma di periodi precedenti a scalare come nel seguente modo:
a1=highest[5](roc[1])[9]a2=highest[5](roc[2])[8]a3=highest[5](roc[3])[7]a4=highest[5](roc[4])[6]a5=highest[5](roc[5])[5]a6=highest[5](roc[6])[4]a7=highest[5](roc[7])[3]a8=highest[5](roc[8])[2]a9=highest[5](roc[9])[1]a10=highest[5](roc[10])Grazie milleMax01/16/2022 at 7:36 PM #185629Eccolo (non l’ho provato):
123456x = 0For i = 1 to 10j = 10 - ix = max(x,(highest[5](roc[i]))[j])Nextreturn x -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
Find exclusive trading pro-tools on
Similar topics: