12 combination indicator (trying to create)
Forums › ProRealTime English forum › ProBuilder support › 12 combination indicator (trying to create)
- This topic has 11 replies, 2 voices, and was last updated 4 years ago by Vonasi.
-
-
02/21/2020 at 5:30 PM #120171
Hi!
Very new to this, but I am trying to write my very own combination indicator, without much success.
What I want to create is a indicator line that goes from it lowest value “0” (if none of the requirements are met) to the highest “12”(if all requirements are met)
My guess is that I need to first create a variable called something like “CountingVariable” … and then, as conditions are met, it will add a +1 to this variable …
The conditions are:
if
- HVO[100] > 20(close) then add +1 point
- RSI[7](close) > 80 … 3-16 days ago then add +1 point
- Upper BollingerBand[20, 2stdev] pointing upwards then add +1 point
- Todays date is between the 24th this month and the 3rd the coming month, then add +1 point
- Close > average[200] then add +1 point
- CCI[6] crosses over -100 then add+1 point
- RSI[2](close) 3 days ago < 60, then add +1 point
- RSI[2](close) fallen for 3 days, then add +1 point
- %D[5](close) < 10 then add +1 point
- RSI[2](close) < 20 then add +1 point
- RSI[2](close) < 10 then add +1 point
But how do I create the function that adds 1 point to the indicator line for every requirement that is met … ?
02/21/2020 at 5:55 PM #12017202/21/2020 at 6:00 PM #120174Personally I prefer to present the result as a % so would do it like this so that you can add or remove conditions and the calculations still works.
123456789101112131415161718count = 0tests = 0if RSI[2] < 20 thencount = count + 1endiftests = tests + 1if RSI[2] < 10 thencount = count + 1endiftests = tests + 1//.....and repeat however many times you like.result = (count/tests)*100return result02/21/2020 at 6:27 PM #120179Wow, thank you very much!
Is it to much to ask for if you could help me with the function for the date conditions ?
I´m trying to find something in the help section for the limitation between the 24th this month and the 3rd the coming month … But as I can see it I can only return the current date?
So I guess I need to make the function that brings up todays date and then look if this date is between the 24th and the 31st this month, or between the 1st and the 3rd the upcoming month … Will an error occur because there are some months with only 30 days etc … ?
And when I want to check if RSI[2] was < 60 3 days ago …. and fallen for 3 days … do I need to write an IF function for this as well ?
- Todays date is between the 24th this month and the 3rd the coming month, then add +1 point
- RSI[2](close) 3 days ago < 60, then add +1 point
- RSI[2](close) fallen for 3 days, then add +1 point
02/21/2020 at 6:30 PM #12018102/21/2020 at 6:38 PM #12018502/21/2020 at 6:43 PM #120188OPENDAY returns the day of the month that a candle opens on so:
1234if openday >=24 or openday <= 3 thencount = count + 1endiftests = tests + 1The number of days in the month makes no difference.
RSI < 60 three days ago is a little more complicated depending upon what time frame you are using or if you want it to work on all time frames?
1 user thanked author for this post.
02/21/2020 at 6:58 PM #12018902/21/2020 at 7:08 PM #120190That’s easier then. The current bar is bar 0 so three days ago is bar 3.
1if rsi[2](close[3]) < 60 thenFalling for 3 days needs a SUMMATION.
1if summation[3](rsi[2](close) < rsi[2](close[1])) = 3 thenThis will check the last 3 days including the current one.
1 user thanked author for this post.
02/21/2020 at 7:11 PM #120191Like this condition
RSI[7](close) > 80 3-16 days ago …..
this is giving me a headache =)
You’ll have to clarify this. Do you mean it was > 80 at any point during the period from 3 days ago to 16 days ago?
02/21/2020 at 7:19 PM #12019202/21/2020 at 7:25 PM #120193 -
AuthorPosts
Find exclusive trading pro-tools on