Correctly calling an indicator
Forums › ProRealTime English forum › ProScreener support › Correctly calling an indicator
- This topic has 7 replies, 5 voices, and was last updated 4 years ago by
Vonasi.
-
-
05/28/2017 at 3:09 AM #36812
Hi,
I have written a personal indicator that uses DRAWARROWUP and DRAWARROWDOWN commands to display arrows directly on the chart.
How do I code a Proscreener that Calls my indicator? What is the condition that I have to screen for?
Example: Assume my probuild indicator is called xyz. Like any indicator, it looks for certain conditions to be met and when met, it draws up and down arrows on the close of the current bar on the chart.
Now I want to write a screener that basically looks on charts of various markets, finds stocks that meet my probuilder indicator.
05/28/2017 at 9:31 AM #36824To call your indicator into your screener, the indi needs to return some values. Just add 2 new variables into your indicator, one that will store the condition met to draw the arrow up and the other one for the opposite. Then add these 2 variables names into your RETURN statement, you should then be able to get them in a CALL instruction to use it into your screener or even an automatic trading strategy.
05/28/2017 at 10:07 PM #36850Thank you Nicolas.
Can you please provide an example code of how to add 2 new variables into my indicator, one that will store the condition met to draw the arrow up and the other one for the opposite?
Walid
05/29/2017 at 9:19 AM #3686505/29/2017 at 6:41 PM #3696804/24/2020 at 11:34 AM #127773Bonjour je ré-ouvre ce post car je souhaite également faire passer un indicateur =1 quand la fonction “DRAWARROW” est actifEnsuite je souhaite faire appel à l’indicateur = 1 pour en retourner un screener car je trouve difficile de retourner directement un screener qui contient les fonctions “DRAW” par rapport à la position du symbole ou texte à afficherEn pièce jointe le code PRT qui détecte le plus bas sur une période et en fonction de 2 moyennes mobilesMerciHello I reopen this post because I also want to pass an indicator = 1 when the “DRAWARROW” function is active
Then I want to use the indicator = 1 to return a screener because I find it difficult to directly return a screener which contains the “DRAW” functions relative to the position of the symbol or text to display
In attachment the PRT code which detects the lowest over a period and based on 2 moving averages
Thank you
123456789101112131415161718192021222324MMC = wilderaverage[5](close)MML = wilderaverage[10](close)IF MMC crosses under MML THENBAS = lowENDIFIF MMC < MML THENIF low <= BAS THENBAS = lowNIVbas = barindexENDIFENDIFX = barindex - (barindex - NIVbas)Y = BAS - averagetruerange[14](close)/2IF MMC crosses over MML THENDRAWARROWUP(X,Y)coloured(0,150,0)endifRETURN indicateur04/24/2020 at 12:37 PM #127787Bobybrakage – Welcome to the forums. There are some simple rules that everyone using the forums is expected to follow. Your post has broken one or more of these rules.
The forum rules are as follows. 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. 🙂
04/24/2020 at 12:41 PM #127790Like this:
123456789101112131415161718192021222324MMC = wilderaverage[5](close)MML = wilderaverage[10](close)IF MMC crosses under MML THENBAS = lowENDIFIF MMC < MML THENIF low <= BAS THENBAS = lowNIVbas = barindexENDIFENDIFX = barindex - (barindex - NIVbas)Y = BAS - averagetruerange[14](close)/2result = 0IF MMC crosses over MML THENresult = 1endifRETURN result -
AuthorPosts
Find exclusive trading pro-tools on