Announcement

Collapse
No announcement yet.

drawShapeRelative problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • drawShapeRelative problems

    Hi,

    I'm trying to add entry and exit signals to my strategy but I'm having trouble getting the drawShapeRelative function to work at all. This is an example of the signals I am using with the new drawing function:

    if (//**entry signal**//) {
    Strategy.doLong("enter Long", Strategy.CLOSE, Strategy.THISBAR);
    drawShapeRelative(0, low(0), Shape.UPARROW, null, Color.blue, Shape.ONTOP | Shape.TOP, getValue("RawTime") + "buy"); }

    The whole formula continues to work exactly the same as before but still without any shapes denoting entry and exit signals. Please can someone tell me what I'm doing wrong here?

    Many thanks in advance

  • #2
    Re: drawShapeRelative problems

    naples99
    The drawShapeRelative() command you posted appears to be working at my end [see screenshot enclosed below] so the issue may lie somewhere else in your code
    Alex




    Originally posted by naples99
    Hi,

    I'm trying to add entry and exit signals to my strategy but I'm having trouble getting the drawShapeRelative function to work at all. This is an example of the signals I am using with the new drawing function:

    if (//**entry signal**//) {
    Strategy.doLong("enter Long", Strategy.CLOSE, Strategy.THISBAR);
    drawShapeRelative(0, low(0), Shape.UPARROW, null, Color.blue, Shape.ONTOP | Shape.TOP, getValue("RawTime") + "buy"); }

    The whole formula continues to work exactly the same as before but still without any shapes denoting entry and exit signals. Please can someone tell me what I'm doing wrong here?

    Many thanks in advance

    Comment


    • #3
      Thanks for such a speedy reply Alexis.

      Seems I made a rookie error. I had SetPriceStudy(false) instead of setPriceStudy(true)

      Seems to work fine now.

      This is the first graphics code I have put into my strategies. I found the tutorial very concise and helpful but maybe you guys could add a reminder that in order to plot on the chart window you need to have setPriceStudy(true), I think it'd help the more code-challenged newbies like me a lot.

      Thanks again

      Comment


      • #4
        naples99
        You are welcome
        Alex


        Originally posted by naples99
        Thanks for such a speedy reply Alexis.

        Seems I made a rookie error. I had SetPriceStudy(false) instead of setPriceStudy(true)

        Seems to work fine now.

        This is the first graphics code I have put into my strategies. I found the tutorial very concise and helpful but maybe you guys could add a reminder that in order to plot on the chart window you need to have setPriceStudy(true), I think it'd help the more code-challenged newbies like me a lot.

        Thanks again

        Comment

        Working...
        X