Minimum 5 Closes above SMA50
Forums › ProRealTime English forum › ProBuilder support › Minimum 5 Closes above SMA50
- This topic has 10 replies, 2 voices, and was last updated 2 years ago by Alex72.
-
-
07/03/2022 at 4:50 PM #19667907/03/2022 at 11:21 PM #196696
Only post in the language of the forumthat you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Moved from the French forum.
Thank you 🙂
07/04/2022 at 10:59 AM #196721There you go:
12345678910111213DEFPARAM DrawOnLastBarOnly = TrueONCE x= 0ONCE y= 0N = 5Sma50 = average[50,0](close)Above = summation[N](close > Sma50) = NPivot = highest[N](high)IF Above THENx = BarIndex-N+1y = PivotENDIFDrawsegment(x,y,BarIndex+1,y) coloured(0,0,255,255)RETURN07/09/2022 at 2:13 PM #197057Thank you
nothing is displayed if i let this
DEFPARAM DrawOnLastBarOnly = True
And when i erase it , i got he signal like in the attachement.
Can i have the signal only once when the condition is met and will repeat it when the price meet the condition once again after the next first 5 closes above SMA50?
Thank you
07/09/2022 at 3:14 PM #197059Sorry: here are the condition:
- C1=First 5 Closes above SMA50
- C2=Last Pivot high when C1 is true
- Draw segment when price cross above this last Pivot (from the pivot to the Barindex )
The process restart again if price closes back under SMA50 without getting C1
Thank you
07/10/2022 at 3:19 PM #197078The code above works fine as it is written (see attached pic) and displays only on the last bar (if there’s a valid signal).
This version will only plot AFTER 5 (or more) bars from the last signal:
123456789101112131415ONCE x = 0ONCE y = 0ONCE Count = 0ONCE N = 5Count = Count - 1Sma50 = average[50,0](close)Above = summation[N](close > Sma50) = NPivot = highest[N](high)IF Above AND (Count <= 0) THENx = BarIndex-N+1y = PivotCount = 5Drawsegment(x,y,BarIndex,y) coloured(0,0,255,255)ENDIFRETURN07/11/2022 at 9:58 AM #19711407/11/2022 at 10:08 AM #197115What’s wrong in my last code?
07/11/2022 at 10:14 AM #19711707/11/2022 at 10:19 AM #197120Sorry, I attached a wrong picture.
Roberto
07/11/2022 at 11:47 AM #197125 -
AuthorPosts
Find exclusive trading pro-tools on