Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on Generating Strategy

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

  • NinjaTrader_Austin
    replied
    Hello there, when you add additional data series to a script, there are more arrays created to store the additional data. The primary instrument's most recent close will be stored in Closes[0][0], while the additional instrument's closes will be stored in Closes[1][0]. Likewise, you can reference these closes in the moving average calculation:
    Code:
    double fiveMinSMA = SMA(Closes[1], 200)[0];

    Leave a comment:


  • sandeshrai
    replied
    Using 5 min SMA in 5 Range Chart

    I have developed a strategy which works on 5 Range chart. However, I would like to use the 200 SMA of a 5 Min chart in my strategy instead of the 200 SMA of the 5 Range chart.

    I have already added the 5 minute bar data as follows:

    protected override void Initialize()

    {

    // Add a 5 minute Bars object to the strategy
    Add(PeriodType.Minute, 5);


    How do I replace the following code to refer to the SMA of the 5 min chart?

    && Close[0] > SMA (200)[0]

    As you can see I am a Newbie programmer

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Correct, normally this should not be the source of your issues - please try the manual compile of scripts nonetheless to investigate why this message is being thrown, perhaps you're just missing a reference dll...

    Thanks,

    Leave a comment:


  • sandeshrai
    replied
    Originally posted by NinjaTrader_Bertrand View Post
    Please see those tips / steps here to help iron out those present NinjaScript programming errors - http://www.ninjatrader.com/support/f...ead.php?t=4678

    All your scripts will need to be in so called compilable state (no programming errors), as NinjaTrader compiles all those into one DLL assembly to be used at runtime.
    I have not generated the code manually. I have used the strategy analyzer's 'Strategies' feature to develop the code. It is quite unusual that the code generated by the strategy analyzer is generating errors

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Please see those tips / steps here to help iron out those present NinjaScript programming errors - http://www.ninjatrader.com/support/f...ead.php?t=4678

    All your scripts will need to be in so called compilable state (no programming errors), as NinjaTrader compiles all those into one DLL assembly to be used at runtime.

    Leave a comment:


  • sandeshrai
    started a topic Error on Generating Strategy

    Error on Generating Strategy

    I have been trying to generate new strategies today using strategy analyzer. However, regardless of what strategy I am trying to save or compile, I get an error: "Error on generating strategy". I was able to save the same strategy earlier. This is happening with all my previously saved strategies as well as new strategies

Latest Posts

Collapse

Topics Statistics Last Post
Started by DannyP96, 05-18-2026, 02:38 PM
1 response
31 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 05-11-2026, 05:56 AM
0 responses
117 views
0 likes
Last Post CarlTrading  
Started by CarlTrading, 05-10-2026, 08:12 PM
0 responses
69 views
0 likes
Last Post CarlTrading  
Started by Hwop38, 05-04-2026, 07:02 PM
0 responses
227 views
0 likes
Last Post Hwop38
by Hwop38
 
Started by Mindset, 04-21-2026, 06:46 AM
0 responses
309 views
0 likes
Last Post Mindset
by Mindset
 
Working...
X