NexusFi: Find Your Edge


Home Menu

 





Store real time data from NT in mysql


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one bascher with 10 posts (0 thanks)
    2. looks_two Big Mike with 7 posts (3 thanks)
    3. looks_3 Lornz with 2 posts (1 thanks)
    4. looks_4 medias with 1 posts (0 thanks)
      Best Posters
    1. looks_one ktrader with 2 thanks per post
    2. looks_two shodson with 2 thanks per post
    3. looks_3 Lornz with 0.5 thanks per post
    4. looks_4 Big Mike with 0.4 thanks per post
    1. trending_up 10,507 views
    2. thumb_up 8 thanks given
    3. group 5 followers
    1. forum 23 posts
    2. attach_file 1 attachments




 
Search this Thread

Store real time data from NT in mysql

  #11 (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,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


bascher View Post
If I attach the indicator at 3 currencies it works fine and I can store all data but if I attach the
indicator at another currency there happens nothing more than before.

Catch the SQL errors, maybe a connection limit.

Mike

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

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #12 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

That is the problem there occurs no error message. In the output window in NT the insert query for only three securities occurs. If I attach the indicator at another there happens nothing more everything is like before and the data can´t be stored in Mysql. I hope someone can help me.
Thank you in advance

Attached Files
Elite Membership required to download: NinjaTraderMySql.txt
Started this thread Reply With Quote
  #13 (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,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


Check your concurrent connection limit in mysql.

Mike

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
  #14 (permalink)
EricForsell
LONG BEACH CA/US
 
Posts: 1 since Oct 2011
Thanks Given: 1
Thanks Received: 0


bascher View Post
Hallo,

I have some problems to store the data in Mysql:

MyInsertQuery:

string myInsertQuery = String.Format("Insert INTO data1 (date, time, lastprice, volume) Values({0}, {1}, {2}, {3})", now_date_marketlast, now_time_marketlast, e.Price, e.Volume);

My table in Mysql:
CREATE TABLE `data1` ( `id_tick` int(16) NOT NULL auto_increment, `date` varchar(8) NOT NULL, `time` varchar(17) NOT NULL, `lastprice` float NOT NULL, `volume` int(8) NOT NULL, PRIMARY KEY (`id_tick`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
Output in Ninjatrader:

Insert Into data1 (date, time, lastprice, volume) Values(20111018, 1509312430, 1,3724, 4646000)
Error on calling 'OnMarketData' method for indicator 'NinjatraderMysql': Column count doesn´t match value count at row 1

Best regards
Benjamin


I always put single quotes ' around my data fields in mysql even if it's a number. It works great.

Reply With Quote
  #15 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709


bascher View Post
That is the problem there occurs no error message. In the output window in NT the insert query for only three securities occurs. If I attach the indicator at another there happens nothing more everything is like before and the data can´t be stored in Mysql. I hope someone can help me.
Thank you in advance

Check the "Log" tab in the Control Center. if you have unhandled exceptions they will not show up in the Output window, rather, they will show up in the Log tab with yellow background color.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #16 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

Thank you shodson. The Log tab told me tha the max number (3) of market depht requests has been reached 309:
Is there a way to evade that for instance to write the code in another way.

Started this thread Reply With Quote
  #17 (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,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


bascher View Post
Thank you shodson. The Log tab told me tha the max number (3) of market depht requests has been reached 309:
Is there a way to evade that for instance to write the code in another way.

Would you post the exact error message please?

Mike

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
  #18 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

Max number (3) of market depht requests has been reached 309:

Started this thread Reply With Quote
  #19 (permalink)
 NetTecture 
Szczecin
 
Experience: Intermediate
Platform: Ninja, writing own now
Posts: 211 since Mar 2010

Maybe your IO subsystem gets overloaded and the adapter falls behind, and NinjaTrader tells you the queue is too long? Try faster discs - best a SSD - for the database.

Reply With Quote
  #20 (permalink)
 
ktrader's Avatar
 ktrader 
glostrup, denmark
 
Experience: Advanced
Platform: Custom platform
Broker: CQG
Trading: Futures, Options, Stocks
Posts: 249 since Aug 2011
Thanks Given: 152
Thanks Received: 275



bascher View Post
Max number (3) of market depht requests has been reached 309:

The error message is identical to an IB-api error message, are you using interactive brokers as datafeed?

If its interactive brokers datafeed, it means you can only receive market depth for 3 distinct symbols at a time.

Reply With Quote
Thanked by:




Last Updated on November 4, 2011


© 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