Squeeze Momentum Indicator code conversion
Forums › ProRealTime English forum › ProBuilder support › Squeeze Momentum Indicator code conversion
- This topic has 8 replies, 2 voices, and was last updated 4 years ago by hobby trader.
-
-
05/12/2020 at 8:52 PM #131387
Hi,
Does anyone know if its possible to convert this code to be PRT compatible, if it is, does anyone know where I can get it done? I can do basic stuff but this is beyond me
Thanks
123456789101112131415161718192021222324252627282930313233343536study(shorttitle = "SQZMOM_LB", title="Squeeze Momentum Indicator [LazyBear]", overlay=false)length = input(20, title="BB Length")mult = input(2.0,title="BB MultFactor")lengthKC=input(20, title="KC Length")multKC = input(1.5, title="KC MultFactor")useTrueRange = input(true, title="Use TrueRange (KC)", type=bool)// Calculate BBsource = closebasis = sma(source, length)dev = multKC * stdev(source, length)upperBB = basis + devlowerBB = basis - dev// Calculate KCma = sma(source, lengthKC)range = useTrueRange ? tr : (high - low)rangema = sma(range, lengthKC)upperKC = ma + rangema * multKClowerKC = ma - rangema * multKCsqzOn = (lowerBB > lowerKC) and (upperBB < upperKC)sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC)noSqz = (sqzOn == false) and (sqzOff == false)val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)),lengthKC,0)bcolor = iff( val > 0,iff( val > nz(val[1]), lime, green),iff( val < nz(val[1]), red, maroon))scolor = noSqz ? blue : sqzOn ? black : grayplot(val, color=bcolor, style=histogram, linewidth=4)plot(0, color=scolor, style=cross, linewidth=2)05/12/2020 at 9:39 PM #131396Besides breaking some simple forum rules with your post…. if you are requesting a free conversion from another coding language to ProRelaCode the follow the instructions here and from the link found under ‘Help’:
I have highlighted in bold the rule/rules that you have not followed:
Post your topic in the correct forum.
ProRealTime Platform Support only platform related issues.
ProOrder only strategy topics.
ProBuilder only indicator topics.
ProScreener only screener topics
General Discussion any other topics.
Welcome New Members for new forum members to introduce themselves.Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
Be careful when quoting others in your posts. Only use the quote option when you need to highlight a particular bit of text that you are referring to or to highlight that you are replying to a particular member if there are several involved in a conversation. Do not include large amounts of code in your quotes. Just highlight the text you want to quote and then click on ‘Quote’.
Give your topic a meaningful title. Describe your question or your subject in your title. Do not use meaningless titles such as ‘Coding Help Needed’.
Do not include personal information such as email addresses or telephone numbers in your posts. If you would like to contact another forum member directly outside of the forums then contact the forums administrator via ‘Contact Us’ and they will pass your details on to the member that you wish to contact.
Always be polite and courteous to others.
Have fun.I have edited your post where required. Please ensure that your future posts meet these few simple forum rules. 🙂
05/12/2020 at 9:44 PM #13139705/13/2020 at 7:39 AM #131431Vonasi,
I wasn’t aware I had posted in the wrong area, wasn’t done on purpose, I assume you’ve now moved my post to the correct area. I didn’t realise my title wasn’t descriptive enough…I’ll make sure it is in future. As for the Insert PRT code, wast aware this existed but I do now, I also wasn’t aware of the free code conversion otherwise I would have posted it directly in there.
I did search for Squeeze Momentum and I found one that says its even been converted from the same code I posted, only issue is, it has a variable that says not in use, based on this I don’t know if the values returned on the indicator are the same as the original indicator posted.
Thanks
Steve
05/13/2020 at 8:11 AM #131434If you downloaded the indicator from the library and imported it into your platform then it should function correctly – otherwise I’m sure there would be plenty of comments saying that it does not work.
If however you just cut and pasted the code then some variables are most likely rem’d out so it won’t work without unremarking them. If you have done this and it says there is an unused variable then just rem that one out again.
Downloading and importing is always the best was to get indicators from the library because the author may even have set up colours, styles and colour zones and saved them as the settings for the indicator to make the indicator display properly.
05/13/2020 at 8:44 AM #131441Yes I downloaded and imported it, as I said it returns values on the indicator but I have a variable with a ‘!’ next to it as its not used in the code, therefore I do not know the the values on the indicator are correct
05/13/2020 at 8:55 AM #13144205/13/2020 at 9:12 AM #131445Ignore my last question. I just imported both of them and see what you are saying is happening. If you read the comments on the library post you can see that Nicolas provided an answer to this issue. Just change line 18 to:
1dev = mult * std[length](source)05/13/2020 at 3:50 PM #131510 -
AuthorPosts
Find exclusive trading pro-tools on