Code of series of periods
Forums › ProRealTime English forum › ProBuilder support › Code of series of periods
- This topic has 24 replies, 5 voices, and was last updated 5 years ago by Vonasi.
-
-
08/04/2019 at 2:34 PM #104155
All’s well that ends well! 🙂
08/04/2019 at 2:51 PM #104157All’s well that ends well!
Maybe not … @maximus78 may have used Roberto code (thinking it was correct / what he needed) and has blown his account … never to be seen again!
Only teasing! 🙂
08/04/2019 at 2:55 PM #104158Yes, but he can refund it and win this time! 🙂
08/04/2019 at 2:57 PM #104159I know reviving old topics may be dangerous, but keeping an error running is more dangerous!
08/04/2019 at 6:19 PM #104168Hello guys, I remember I have verified the code line of Roberto and it was right.
Now I have verified again in this way and as you can see the results are exactly the same.
I did an indicator called Maximus with the code of my request:
123456789a=close>close[1] and close>close[2] and close>close[3] and close>close[4] and close>close[5]if a thenresult=1elseresult=0endifreturn resultThen i did another indicator called Roberto with his code:
1234567IF close > highest[5](close[1]) THENresult=1elseresult=0endifreturn resultComparing the results of the binary indicators you see they gives the same results.
Max
08/04/2019 at 6:37 PM #104173…and the final test. All three in one indicator and output compared. They all do the same thing.
123456789101112131415161718192021222324252627282930313233343536373839//maximusa=close>close[1] and close>close[2] and close>close[3] and close>close[4] and close>close[5]if a thenresult=1elseresult=0endif//robertoIF close > highest[5](close[1]) THENresult2=1elseresult2=0endif//vonasix = 5count = 0for i = 1 to xif close > close[i] thencount = count + 1endifnextresult3 = 0if count = x thenresult3 = 1endif//final checkresult4 = result + result2 + result3flag = 0if result4 <> 0 and result4 <> 3 thenflag = 1endifreturn flag08/04/2019 at 8:43 PM #10418308/04/2019 at 8:53 PM #104185more than one way to splice the mainbrace eh!
…or more than one way to skin a cat….. or more than one way to trip over it in Roberto’s case! 🙂
08/04/2019 at 8:54 PM #104186Yes, the first 3 snippets yield the same results, but not my 4th one (summation).
So this one is the incorrect one.
08/04/2019 at 9:38 PM #104192but not my 4th one (summation).
Thank God one of us has finally confirmed that we were wrong – even if it was only 50% wrong! 🙂
-
AuthorPosts
Find exclusive trading pro-tools on