Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8b9 How to stop NT to generate wrapper for partial class IndicatorBase

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

    NT8b9 How to stop NT to generate wrapper for partial class IndicatorBase

    I want to split my custom indicator base into separate files using partial class:
    Code:
    [FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]
    [SIZE=2][FONT=Consolas][COLOR=#0000ff]public [/COLOR][/FONT][/SIZE][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]partial [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] my[/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IndicatorBase[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] : [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Indicator[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
    Unfortunately NT8 keeps generating the wrapper for both files causing compile error:
    "The type 'NinjaTrader.NinjaScript.Indicators.Indicator' already contains a definition for 'cachemyIndicatorBase'"

    Is there a way to stop NT8 from generating wrapper for specific file/namespace/class?
    If not is there any workaround for this issue?

    #2
    Place it in the AddOns folder instead.

    Comment


      #3
      Thanks! Can't try at the moment but looks like it will work (if NT generates wrapper based on the file location and not on the namespace as I naively assumed).

      This is also one more reason why adding other folders (like eg.: "Common") to the "Custom" project are so important - my AddOn folder already includes so much stuff unrelated to add ons that more appropriate name for it would be "Everything-Else-You-Have-No-Idea-Where-To-Put-Or-Cannot-Put-Anywhere-Else"

      Comment


        #4
        Hello gregid,

        wbennettjr is correct the and partial classes will need to be in the Addons folder.

        Please see the following thread below for an example of partial classes.
        http://ninjatrader.com/support/forum...980#post442980
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mongo, Yesterday, 11:05 AM
        6 responses
        27 views
        0 likes
        Last Post Mongo
        by Mongo
         
        Started by ct, 05-07-2023, 12:31 PM
        7 responses
        206 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by wzgy0920, Yesterday, 09:53 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Rapine Heihei, Yesterday, 07:51 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by kaywai, Today, 06:26 AM
        1 response
        6 views
        0 likes
        Last Post kaywai
        by kaywai
         
        Working...
        X