How to add text

Viewing 9 posts - 1 through 9 (of 9 total)
  • #215679

    Hi, I’d like to insert some text above a below the current candle (according to certain conditions). The DRAWTEXT method (https://www.prorealcode.com/<wbr />documentation/drawtext/) doesn’t seem to work. Can someone explain where’s the error in the below code ?

    And btw, it’d be nice to get more insight about syntax error, a hint when mousing over the warning symbol for instance…

    Thanks

    Fred

    PS : sorry I didn’t keep the source code, just a screen shot (attached) and tried to reproduce something meaningful above

    #215683

    Line 1 cannot be used in indicators, it’s reserved for strategies (indicators don’t deal with orderes).

    Line 2 will make ALL graphic objects and text being cancelled and being drawn again each new candle, so once bStart is set, the IF conditions will no more be met, thus DrawText will never be executed again, unless you clear bStart somewhere, and you wll no more seee the text that was previously printed.

    Any line starting with IF must end with THEN (this concerns the code you posted, not the one in the attached pic).

     

    #215684

    The screenshot is from a tradingsystem code.

    OK, let’s assume the code is not going to do what I want (I’d delete line 2 then), still it wouldn’t compile. What’s the problem with line 13 ?

    #215686

    This is the correct code for ProRealTime:

    all indicators must end with the keyword RETURN.

     

    #215687

    I guess the DRAWTEXT function doesn’t work in TradingSystem coding environment (see the little warning icon indicating a syntax / compile error on the screenshot ?).

    Of course, if I put it in an indicator code, everything works fine (no warning icon).

    But this is neither what I want nor what I was trying to explain.

    Thanks for your help anyway

    #215689

    Trading systems cannot plot text, or objects. They can only enter and exit trades.

     

     

    #215690

    Of course, if I put it in an indicator code, everything works fine (no warning icon).

    Hi Fred,

    The answer to your “line 13” question is : All of these commands only apply to Indicator code (which end with the Return command).

     

    The screenshot is from a tradingsystem code.

    In brief, that only allows for Graph and GraphOnPrice.  Nothing of the graphical “nice stuff” works in that part of the platform.
    It is a bit confusing, but you will get used to it.

    Peter

    #215701

    There is also now a new instruction to show variables in trading systems: PRINT

    #215706

    … with the notice that this now also works with Indicators (assuming that “trading systems” was meant to say just that). I did not really use/test it for Indicators yet but for trading systems it is great.

    But maybe mentioned too early (after all 😉 ) because it is only for V12. At least for me it’s not there in V11.1.

Viewing 9 posts - 1 through 9 (of 9 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login