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 Mindset, 04-21-2026, 06:46 AM
0 responses
88 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
134 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
68 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
119 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
67 views
0 likes
Last Post PaulMohn  
Working...
X