issue call instruction of an indicator with DRAWTEXT

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #44656 quote
    mmichael
    Participant
    Average

    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

    #44657 quote
    mmichael
    Participant
    Average

    Code of the indicator: “myindic”

    if close >= average[50](close) then
    trendstate = 1
    //DRAWTEXT("•",barindex,0,monospaced,standard,11) coloured(40,200,0,190)
    else
    trendstate = -1
    endif
    
    RETURN trendState coloured(255,160,40,0) style(Point,1) as "trend"

    Code of the screener that calls the indicator:

    TIMEFRAME(4 hours)
    trendValue = CALL "myindic"
    screener (trendValue as "trend")

    if we decomment the line drawtext in the indicator, the screener stops working

    #44669 quote
    AVT
    Participant
    Senior

    I 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.

    mmichael thanked this post
    #44683 quote
    mmichael
    Participant
    Average

    thx AVT for your answer.

    if I understand well, the presence of DRAWxxx functions in an indicator make it impossible to call it from a screener.

    This is a weird bug / regression.

    #44710 quote
    Nicolas
    Keymaster
    Master

    Very 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.

    #44824 quote
    Nicolas
    Keymaster
    Master

    I 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 🙂

    AVT and mmichael thanked this post
    #44972 quote
    mmichael
    Participant
    Average

    thank 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.

    #45042 quote
    Nicolas
    Keymaster
    Master

    Returned values are only ones in RETURN instruction line of your code.

    mmichael thanked this post
    #45981 quote
    mmichael
    Participant
    Average

    Hello Nicolas, any new for this wheather if it is fixed or not?

    Again, I am sorry but it is an ugly bug!

    #46444 quote
    Nicolas
    Keymaster
    Master

    All bugs are ugly IMO 🙂 I don’t know if it has already been fixed (did you try recently?) but I know for sure it will be very soon.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

issue call instruction of an indicator with DRAWTEXT


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
mmichael @mmichael Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by Nicolas
8 years, 5 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 08/26/2017
Status: Active
Attachments: No files
Logo Logo
Loading...