Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy and plotting a line

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

    Strategy and plotting a line

    Hi,

    I want to generate automated trades with EnterLong() and its cousins. I'm told I have to use a strategy since EnterLong() will not work inside an indicator (compilation fails).

    I also need to have lines drawn on the chart. These lines will represent the entry and exit points that are being monitored. Should the price action hit them, orders to buy or sell will be automatically generated.

    Add(new Plot(Color.Green,PlotStyle.Line, "PlotBuyLine"));

    is giving me the following error when I try to compile my strategy. Is this supported? If not, what are my options?

    Error: The best overload method match for NinjaTrader.... has some invalid arguments.

    Thanks in advance.

    -mp

    #2
    Hello,

    It is possible to plot from a strategy, however it will be a little different than you use in an indicator.

    Please take a look at our reference sample on Plotting from within a NinjaScript Strategy and let me know if you have any questions:

    When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    169 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    324 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    250 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    351 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    180 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X