Announcement

Collapse
No announcement yet.

Help with drawTextPixel

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

  • Help with drawTextPixel

    I am using the drawTextPixel command to display the entry and stop prices of my strategy in the lower left corner of the chart.

    I run the same script on different charts, and it works fine on all of the charts, except in the GBP chart.

    Here is the script, any ideas?

    // display entry and stop levels
    if ( Trade == 'Long' || Trigger == 'Long' ){
    EntryPrice = LongEntry.toFixed(4);
    StopPrice = Stop.toFixed(4);
    drawTextPixel( 1, 13, StopPrice, Color.red, null, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 200);// display stop price
    drawTextPixel( 1, 35, EntryPrice, Color.blue, null, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 201);// display entry price
    }

    if ( Trade == 'Short' || Trigger == 'Short' ){
    EntryPrice = ShortEntry.toFixed(4);
    StopPrice = Stop.toFixed(4);
    drawTextPixel( 1, 13, StopPrice, Color.red, null, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 200);// display stop price
    drawTextPixel( 1, 35, EntryPrice, Color.blue, null, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 201);// display entry price
    }

  • #2
    JHarvey407
    FWIW I added the code sample you posted to a moving average strategy and as far as I can see it is writing the correct values even when using GBP as the symbol.
    Alex

    Comment

    Working...
    X