issue call instruction of an indicator with DRAWTEXT
Forums › ProRealTime English forum › ProScreener support › issue call instruction of an indicator with DRAWTEXT
- This topic has 9 replies, 3 voices, and was last updated 7 years ago by Nicolas.
-
-
08/26/2017 at 12:01 AM #44656
Hello,
I am developping a screener based on a custom indicator. this is used by the call instruction from the screener.
The screener does not return any result, so I I investigated and it seems to be due to the use of drawtext() in the indicator.
When I remove the drawtext in my indicator, the screener works.
Is this a known bug? is there a workaround?
Many thanks in advance for your help
08/26/2017 at 12:13 AM #44657Code of the indicator: “myindic”
myindic12345678if close >= average[50](close) thentrendstate = 1//DRAWTEXT("•",barindex,0,monospaced,standard,11) coloured(40,200,0,190)elsetrendstate = -1endifRETURN trendState coloured(255,160,40,0) style(Point,1) as "trend"Code of the screener that calls the indicator:
myscreener123TIMEFRAME(4 hours)trendValue = CALL "myindic"screener (trendValue as "trend")if we decomment the line drawtext in the indicator, the screener stops working
08/26/2017 at 2:57 PM #44669I assume that all those DRAWxxx commands are proBuilder only commands, something like “bring that value somehow into my window”.
Flatly spoken I think of 2 different kind of caches, one keeping the calculated value (which in a “normal” RETURN indi as “myindi” command is used by the return funcion directly) and one for the drawings (which is additionally used by DRAWxxx to insert the calculated value into the x/y axis values). And as a DRAWxxx indicator ends with a simple RETURN, the value (which a “normal” indicator would use now) is empty and cannot be accessed any longer (cause it was inserted into the drawing cache and is then gone).
Your way of changing the last line of the indicator seems the only workaround for me. Just my 2c.
1 user thanked author for this post.
08/27/2017 at 1:27 AM #4468308/27/2017 at 1:32 PM #44710Very interesting, never seen this problem myself… and I can replicate it, thanks for let us know. While I’m still away from my office, could you please send a bug report to prorealtime to let them know about this problem please (CTRL+M)? I will track this one once I come back for good. You can add the link to this topic, I think it is sufficient to explain the bug.
08/29/2017 at 11:27 AM #44824I got news about this problem. The “coloured” instruction creates a problem that does not return the right value when the indicator is CALL(ED). A quick fix would be to delete the COLOURED of your DRAWTEXT line. This issue should be fixed quickly by PRT dev team. Thanks for reported it 🙂
08/31/2017 at 4:13 AM #44972thank you Nicolas for the workaround.
I am not sure to understand. What is the result of the indicator call?
- is it the value of the RETURN statement?
- or is it the drawtext (this would be strange…)
In my case the drawtext –> DRAWTEXT(“•”,barindex,0,monospaced,standard,11) –> this would give 0 I guess
the RETURN statement gives 1 or 0. It makes more sence that the call takes these values and not what is in the drawtext.
08/31/2017 at 2:09 PM #4504209/12/2017 at 3:59 AM #4598109/18/2017 at 7:46 AM #46444 -
AuthorPosts
Find exclusive trading pro-tools on