Simple code returns error message
Forums › ProRealTime English forum › ProOrder support › Simple code returns error message
- This topic has 21 replies, 4 voices, and was last updated 5 years ago by
GraHal.
-
-
03/11/2020 at 5:20 PM #12184603/11/2020 at 6:19 PM #121859
Yes, he can use StocK.
I think the error is at line 15,
Line 8 is logically incorrect, since the average after > will always return 3 but it should not be reported as an error.
03/12/2020 at 4:52 PM #121941Thank you Roberto
I was trying to describe a rising 50 moving average.
Would If avg[50](close)>avg[50][3] then….. be correct.
I know the trailing moving average omits (close) because it’s already
happened, I got the wrong brackets for the 3 which was supposed to be 3 candles back.
back.
The StocK>80 then…. line did work .
Is all this correct ?03/12/2020 at 5:27 PM #12195103/19/2020 at 8:27 PM #12262703/20/2020 at 9:54 AM #122670There you go:
12345MyMACDmainline = MACDline[12,26,9](close) //difference between the two EMA'sMyMACDsignal = ExponentialAverage[9](MyMACDmainline) //ema of the above line (MyMACDmainline)MyMACDhistoGram = MACD[12,26,9](close) //histogramAboveMACD = MyMACDmainline > MyMACDsignalBelowMACD = MyMACDmainline < MyMACDsignalyou can use variables AboveMACD and BelowMACD in your code (in the above code the histogram is not used, if you don’t need it you may want to either remove or comment out line 3).
03/20/2020 at 10:25 AM #122675Above added as Log 203 in here …
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on