Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        84 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        46 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        66 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        69 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Working...
        X