Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Could not detemine JSON object type

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

    Could not detemine JSON object type

    I developing AddOn and try send my list of Connection and my Acccounts to my server through sockets.
    But when i try send
    Connection.Connections or Account.All

    i got error
    Code:
    Unhandled exception: Could not determine JSON object type for type NinjaTrader.Cbi.Connection
    for Connection.Connections
    Code:
    Unhandled exception: Could not determine JSON object type for type NinjaTrader.Cbi.Account
    and for Account.All

    #2
    Hello Pripersian,

    Welcome to the NinjaTrader forums!

    Connecting to a server or using JSON are advanced concepts that would not be supported by NinjaTrader Support or documented in the NinjaTrader Help guide.
    ​​​​​​There can be limitations using advanced C# concepts, in NinjaScript, so your mileage may vary. As of now, we do not have any examples that can be used to navigate that path.

    This thread will remain open for any community members that would like to assist with the unsupported code side of things.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Pripersian View Post
      I developing AddOn and try send my list of Connection and my Acccounts to my server through sockets.
      But when i try send
      Connection.Connections or Account.All

      i got error
      Code:
      Unhandled exception: Could not determine JSON object type for type NinjaTrader.Cbi.Account
      and for Account.All
      If you have not yet done so I would expect Step 1 to be using the NinjaScript TypeConverter AccountNameConverter to convert the account names to String (i.e. Text....)

      Good example in the body and properties of @[email protected]

      .. Documents\NinjaTrader 8\bin\Custom\MarketAnalyzerColumns\@PositionAvgPri ce.cs

      Code:
      #region Properties
      [NinjaScriptProperty]
      [TypeConverter(typeof(AccountNameConverter))]
      [Display(ResourceType = typeof(NinjaTrader.Resource), Name = "NinjaScriptColumnBaseAccount", GroupName = "NinjaScriptSetup", Order = 0)]
      public string AccountName
      { get; set; }
      #endregion
      Hedge

      Comment


        #4
        I think i wrong ask question. NT8 think is Account is JSON class and i want to transform String <--> Account but for this i need json class which describes all variable types and they dependencies.
        Anyway created this class by myself by poke method and got this after success convert. More then enough for me.
        Code:
        {"BPAccountStatistics":null,"Dispatcher":null,"Las tTransactionsSum":0.0,"SyncGW":{},"Commission":nul l,"ConnectionStatus":0,"DailyLossLimit":0.0,"FcmDa te":"1800-01-01T00:00:00","Fee":null,"MarginMultiplier":1.0,"Ma xOrderSize":0,"MaxPositionSize":0,"MinimumCashValu e":0.0,"PrimaryUser":null,"Provider":15,"Risk":nul l,"RiskByMasterInstrument":{},"Transactions":[],"UsersSerializable":"","AccountStatus":1,"Connect ion":null,"Denomination":7,"DisplayName":"Backtest ","ExecutionPositions":null,"Executions":[],"Fcm":"","ForexLotSize":10000,"Id":0,"Liquidation State":2,"Name":"Backtest","Orders":[],"Positions":[],"SimulatorInitialCash":100000.0,"SimulatorDelayEx change":40,"SimulatorDelayInternet":30,"Strategies ":[]}

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Gerik, Today, 09:40 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by RookieTrader, Today, 09:37 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by alifarahani, Today, 09:40 AM
        0 responses
        5 views
        0 likes
        Last Post alifarahani  
        Started by KennyK, 05-29-2017, 02:02 AM
        3 responses
        1,284 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by AttiM, 02-14-2024, 05:20 PM
        11 responses
        185 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X