Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

DrawHorizontalLine("short tp" ,Position.AvgPrice - (tp_ticks)* TickSize,Color.Green

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

    DrawHorizontalLine("short tp" ,Position.AvgPrice - (tp_ticks)* TickSize,Color.Green

    i'm trying to draw line based on (tp_ticks) which is a private int = 10
    Code:
    [SIZE=2][FONT=Courier New][COLOR=#0000ff]private[/COLOR][/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] tp_ticks = 10[/SIZE][/FONT]
    Instrument is the ES and so the line is 10 pts from Market.AvgPrice and not 10 ticks.

    #2
    Does this work for you?

    Code:
    [SIZE=2][SIZE=2]DrawHorizontalLine([/SIZE][/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"short tp"[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2], Position.AvgPrice - (tp_ticks * TickSize), Color.Green, DashStyle.Solid, [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]);[/SIZE][/SIZE]
    [SIZE=2][SIZE=2][/SIZE][/SIZE]

    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AdamDJ8, 05-07-2024, 09:18 PM
    2 responses
    15 views
    0 likes
    Last Post -=Edge=-  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    46 responses
    4,100 views
    3 likes
    Last Post tradgrad  
    Started by usasugardefender, Today, 01:42 AM
    0 responses
    1 view
    0 likes
    Last Post usasugardefender  
    Started by haas88, 03-21-2024, 02:22 AM
    15 responses
    182 views
    0 likes
    Last Post haas88
    by haas88
     
    Started by brianfnoel, Today, 01:24 AM
    0 responses
    6 views
    0 likes
    Last Post brianfnoel  
    Working...
    X