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 shodson with 1 posts (2 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 15,647 views
    2. thumb_up 8 thanks given
    3. group 5 followers
    1. forum 23 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

Hallo everybody,

can somebody point me in the right direction.
Thank you in advance

Best regards
Benjamin


Started this thread Reply With Quote

 
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 R.I.P. 1977-2026 
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,599


bascher View Post
Hallo everybody,

can somebody point me in the right direction.
Thank you in advance

Best regards
Benjamin











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 X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2


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


Started this thread Reply With Quote
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 R.I.P. 1977-2026 
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,599


bascher View Post
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

Your price has a comma in it. Change to decimal.

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 X Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

Hallo Mike,

I tried it all day but I dontīt know how to solve it. Please help me to fix it.

Benjamin


Started this thread Reply With Quote
  #6 (permalink)
 
medias's Avatar
 medias 
Karlsruhe, Germany
 
Experience: Advanced
Platform: MultiCharts, AmiBroker
Broker: IB/IQFeed
Trading: Stocks, Emini ES
Posts: 59 since Jul 2009
Thanks Given: 30
Thanks Received: 49


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

Try this:
Insert Into data1 (date, time, lastprice, volume) Values ('20111018', '1509312430', '1.3724', '4646000')


Reply With Quote
  #7 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

I patched it with:

string ePrice;
ePrice = e.Price.ToString();
ePrice = ePrice.Replace(",", ".");

Benjamin


Started this thread Reply With Quote
  #8 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2

Can it be possible that there is a restriction in storing data from NT in MySql?
I get the data from IB in NT and want to save them in Mysql but this works only for 3 instruments.
What can I do?


Started this thread Reply With Quote
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 R.I.P. 1977-2026 
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,599


bascher View Post
but this works only for 3 instruments.

What do you mean?

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 X Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 bascher 
Germany
 
Experience: Beginner
Platform: NinjaTrader
Trading: DAX, EUR/USD
Posts: 18 since Aug 2010
Thanks Given: 16
Thanks Received: 2


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.


Started this thread Reply With Quote




Last Updated on November 4, 2011


© 2026 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 - Downloads - Top
no new posts