NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 03-11-2011, 09:57 AM   #1
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default primary key value does not exist

Any idea what this is about?

this is in my initialize
SetProfitTarget(CalculationMode.Ticks, target);
SetStopLoss(CalculationMode.Ticks, stop);


2011-03-11 11:36:38:906 Db.Globals.StrategyUpdateJob2: WARNING: Execution='f5aeb0ee365c49cc8f85ab7998906b24' Instrument='ES 03-11' Account='AutoTrade' Name='Short' Exchange=Default Price=1296.5 Quantity=1 Market position=Short Commission=2.5 Order='e0051ce2948241179af5ef05463b6aac' Time='3/10/2011 10:07:16 AM'
2011-03-11 11:36:38:906 Db.Globals.StrategyUpdateJob2: WARNING: Execution='a42b8ab76a484c42ac50535fdd412219' Instrument='ES 03-11' Account='AutoTrade' Name='Trail' Exchange=Default Price=1303.5 Quantity=1 Market position=Long Commission=2.5 Order='52db3bbc9bd9464592c952295728bf0a' Time='3/10/2011 12:00:02 PM'
2011-03-11 11:36:39:236 Failed to execute DB job 'StrategyUpdateJob': A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = FK__nt_strategy2execution__000000000000028B ]
Last edited by gg80108; 03-11-2011 at 10:08 AM. Reason: added info
gg80108 is offline  
Reply With Quote
Old 03-11-2011, 10:39 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello gg80108,

First step with database issues is to run a repair.

Please follow the instructions below to repair the NinjaTrader database.

* Disconnect NinjaTrader from any open connections via File > Disconnect
* From the NinjaTrader Control Center window select the menu Tools > Options
* Select the "Data" tab
* Press the "Repair DB" button
* Press the "OK" button

Let us know if you're still seeing that message after running a repair.
NinjaTrader_RyanM is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does This Indicator Exist On This Forum? maxreturn Charting 4 03-04-2011 06:08 PM
Doesn't exist in current context. NickA General Programming 4 02-10-2011 06:57 AM
Error when Remove Hot Key on collapsed hot key category in Hot Key Manager Neil_ Version 7 Beta General Questions & Bug Reports 2 03-22-2010 03:11 AM
FirstBarOfSession does not exist blarouche Indicator Development 4 04-07-2009 04:02 PM
strategy id ' ' does not exist highflyer Automated Trading 4 12-08-2005 04:43 AM


All times are GMT -6. The time now is 05:09 AM.