Whats the best way I can use the code as a template?
19.06.2020 20.29

Creating Flexible Strategy Architecture in NinjaTrader 8

Rick Hollywood

I want to create a new Architecture with different indicators but everytime I try to make a new template it makes me want to change everything that says Architecture in the code and if i do that i have to change everything that says Architecture in the type converter too....is there a simple way I can change even the version of it and be able to customize the strategy and keep the same name just to make it simple?

  • Yuri Zolotarev
    19.06.2020 21:24

    Just change the class name and adjust the type converter class name and you will get an independent instance of a new copy of the code.

  • Rick Hollywood
    19.06.2020 21:55

    I did everything you told me and im getting this error:

    NinjaScript FileErrorCodeLineColumn
    Arsenal.csCannot implicitly convert type 'NinjaTrader.NinjaScript.Strategies.NinjaCodingCourses.Arsenal' to 'NinjaTrader.NinjaScript.Strategies.NinjaCodingCourses.Architect'CS002940435
  • Yuri Zolotarev
    20.06.2020 10:40

    Probably the old class is referenced somewhere else eg. inside some indicator so why not explore and look for the place where exactly the mistake is coming from? 

  • NinjaCoding friend
    14.06.2023 05:25

    I had the same error message when doing a Save As to rename the strategy. I also did a newly named copy of the TypeConverter. All instances of "Architect" in the TypeConverter also need to be replaced by the name of your strategy.

  • NinjaCoding friend
    27.06.2023 02:51

    One more change is required: The strategy contains this line:"var signal = ArchitectEnrties();"

    You must edit the ArchitectEntries.cs indicator line to replace "Architect" with the name of your new strategy in this line: "public NinjaTrader.NinjaScript.Strategies.NinjaCodingCourses.Architect Strategy

    In case you wonder about it, yes, that is how ArchitectEnrties() is spelled in the strategy.