Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to compile ninjascript strategy from Tools>Export>Add on Strategy

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

    Unable to compile ninjascript strategy from Tools>Export>Add on Strategy

    I created a Moving Average Cross over Ninja Script Automated Strategy. In my script the FastMA is hard coded. Where as the SlowMA is user input for MA Type and Period. Allowing the user to select either SMA or EMA from a dropdown. Although I am able to easily compile the my strategy in NinjaScript Editor but not able to export it from ninjascript strategy from Tools>Export>Add on Strategy as it is giving my compiling errors.

    For my ninjascript Moving Average crossover strategy I have:
    a private IndicatorBase as "private IndicatorBase SelectMAIndicator(MovingAverageType type, int period)" for this line I am getting the error, "error CS0246: The type or namespace name 'MovingAverageType' could not be found (are you missing a using directive or an assembly reference?)"

    I have also added the SlowMA Indicator Type in my Put parameter as:
    [NinjaScriptProperty]
    [Range(0, int.MaxValue)]
    [Display(Name = "SlowMA Indicator Type", Description = "Type of Moving Average for Slow MA", Order = 3, GroupName = "Parameters")]
    public MovingAverageType SlowMAIndicatorType { get; set; }
    For these lines of codes also I am getting the same Error "error CS0246: The type or namespace name 'MovingAverageType' could not be found (are you missing a using directive or an assembly reference?)"

    Everywhere I used 'MovingAverageType' I am getting the Error "error CS0103: The name 'MovingAverageType' does not exist in the current context"​

Latest Posts

Collapse

Topics Statistics Last Post
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
43 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
20 views
0 likes
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
30 views
1 like
Last Post CaptainJack  
Started by CarlTrading, 03-30-2026, 11:51 AM
0 responses
48 views
0 likes
Last Post CarlTrading  
Started by CarlTrading, 03-30-2026, 11:48 AM
0 responses
38 views
0 likes
Last Post CarlTrading  
Working...
X