NexusFi: Find Your Edge


Home Menu

 





FastJSON question


Discussion in NinjaTrader

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




 
 

FastJSON question

 
 
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

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Quantum physics & Trading dynamics
The Elite Circle
OrderFlow-Based Support/Resistance Levels
Emini and Emicro Index
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
Funded Trader platforms
16 thanks
ApexTraderFunding.com experience and review
13 thanks
Trading with Intuition
12 thanks
GFIs1 1 DAX trade per day journal
9 thanks
 
 
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);

 
 
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
 
 
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.

Thanked by:
 
 
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,475 since Jun 2009
Thanks Given: 33,251
Thanks Received: 101,679


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

 



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