NexusFi: Find Your Edge


Home Menu

 





FastJSON question


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one MichaelH with 2 posts (1 thanks)
    2. looks_two rleplae with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 1,274 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

FastJSON question

  #1 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863

I have an indicator that is using a JSON call.
This works fine.

However when I edit this indicator and compile it.
Go to the chart, unload the indicator
add the recompiled indicator back to the chart

I get an exception thrown :

Unhandled exception in MyIndicator.OnBarUpdate(): Unable to cast object of type 'MyData' to type 'MyData'.

This is on the following call :
MyData = fastJSON.JSON.ToObject<List<MyData>>(response);

Exit and reStart of Ninjatrader and all works fine.
response contains the exact same JSON data


Anybody any thoughts ?

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
 
MichaelH's Avatar
 MichaelH 
Munich Germany
 
Experience: Intermediate
Platform: NinjaTrader, MetaTrader
Broker: S5
Trading: DAX, ES
Posts: 53 since Dec 2013
Thanks Given: 75
Thanks Received: 43


looks there is variable called MyData and a type MyData


MyData = fastJSON.JSON.ToObject<List<MyData>>(response);

How is the variable defined ?

would try

MyData myvar = fastJSON.JSON.ToObject<List<MyData>>(response);

Reply With Quote
  #4 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863

Hello Michael

no not really
the variable is defined global

i just anonymized the code a bit

the problem is that the code runs fine until i edit the indicator and compile it
when i reload it , then the problem starts, i don't find a work around

the type is good, as the first time it works just fine

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
MichaelH's Avatar
 MichaelH 
Munich Germany
 
Experience: Intermediate
Platform: NinjaTrader, MetaTrader
Broker: S5
Trading: DAX, ES
Posts: 53 since Dec 2013
Thanks Given: 75
Thanks Received: 43

Then the only thing what comes to my mind, that there is sthg left on reload.
Is there an object or a structure which needs proper termination / disposal

To my experience that can be really anything and does not necessarily have to do with this objects or lines you posted.

Wish all the best to get it working soon.

Reply With Quote
Thanked by:
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665


MichaelH View Post
Then the only thing what comes to my mind, that there is sthg left on reload.
Is there an object or a structure which needs proper termination / disposal

To my experience that can be really anything and does not necessarily have to do with this objects or lines you posted.

Wish all the best to get it working soon.

Improper disposal could cause it to not function, but I don't think it would cause it to not compile...

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on October 26, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts