NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Market Analyzer

Market Analyzer Support for the NinjaTrader Market Analyzer.

Reply
 
Thread Tools Display Modes
Old 02-24-2010, 04:47 AM   #1
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default Running a strategy that prints message from another strategy

Hi!,

Today I was testing one strategy until it didn't work any more, I put a print instruction in first line of OnUpdateBar, but it never showed when running again this strategy, it only displays the messages in initialize method.

Then I createad a new strategy, and it didn't work at the first test, but this time I saw it was printing the messages first from the old strategy (only within initialize method) and then the own messages (again only in initialize method) and never reaches the onupdatebar method where (in this second strategy) I only put a print statement...

I shutted off the NT and restart again, but it displays the same, it doesn't works.

What can I do?

thanks in advance
joanNT is offline  
Reply With Quote
Old 02-24-2010, 05:38 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
Default

joanNT, welcome to the forums - this is partially expected as the Initialize() method is called across all scripts - is the default SampleMACrossOver strategy working for you normally?

Do you see any error message in the log tab as you run the strategies giving you issues?
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 02-24-2010, 06:14 AM   #3
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default Reply

The sample strategy doesn't work too.

The log gives me no error when I run a strategy, except for one that it gave me I think at beginning of tests:

24/02/2010 11:57:32;Strategy;Error on calling 'OnBarUpdate' method for strategy 'LarryWilliams1': El índice estaba fuera del intervalo. Debe ser un valor no negativo e inferior al tamaño de la colección.;

24/02/2010 11:41:39;Strategy;A Buy order placed at '21/03/2007 20:00:00' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.;

This messages could be sent when the first strategy I ran started to work bad, after that problably all the new and old strategies didn't work.

Hope you can fix it.
Thanks
joanNT is offline  
Reply With Quote
Old 02-24-2010, 07:29 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
Default

joanNT, please restart NT fresh, open one chart connected and only apply the SampleMACrossOver from us to check.

The message you get in the log means at some point you submitted an invalid stop order that caused NinjaTrader to ignore it, you would need to debug your order placement to ensure sending valid orders.
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 02-24-2010, 01:02 PM   #5
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default Reply

Hi again,

I've tested the strategy with a new chart and connected, it works with all strategies, BUT within the Strategy Analyzer (SA) doesn't works, when I push the "b" of Run backtest and select the SampleMACrossOver it runs the three initialize methods of the three new strategies I've created today and never reaches the onbarupdate method of any strategy.

By now I can use the strategies in the Chart window and only open de SA for consulting the output window, but I used to write and test the strategies from the SA this was easier.

Could you know another solution to fix this problem?

thanks!!
joanNT is offline  
Reply With Quote
Old 02-24-2010, 02:20 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

joanNT,

So are you saying you cannot even run a backtest of SampleMACrossOver in the Strategy Analyzer? That is odd. Are you sure you have data for that instrument?
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-25-2010, 03:15 AM   #7
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi again!

I do not know what was happening yesterday, today all is working fine, I can run with the AS my strategies and I get what it's supposed to.

I'm running and testing "Multi-Time Frame & Instruments" strategies and I'm wondering why sometimes the openning order executed on a barsinprogress=1 it's drawed in the next barsinprogress=0 bar while in the executtion tab the time of the entry order was at the previous bar, you can see this on the picture annexed:

Thanks
Attached Images
File Type: jpg Multi-time-frame.JPG (11.6 KB, 9 views)
joanNT is offline  
Reply With Quote
Old 02-25-2010, 10:31 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
Default

Is this generated from realtime executions or backtesting on this chart?

For realtime execution you want to ensure your PC clock is synched up as incoming executions would be stamped by this as reference.
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 02-25-2010, 10:57 AM   #9
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default reply

Bertrand,

It's generated from backtesting.

Is this behaviour normal?

Thanks!
joanNT is offline  
Reply With Quote
Old 02-25-2010, 11:03 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
Default

For backtesting, it's expected that trades will be executed on the next possible trade location, which is the open of the next bar per default, as the intrabar tick formation is unfortunately not known when backtesting.
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 02-25-2010, 11:15 AM   #11
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default Reply

Yes, it's what I've expected, cause the log of trades, executions, etc showed in AS where with different timestamp as showed in chart.

Do you know if in the new version of NT does this happen? I ask this cause I know it's possible to add more than one instrument or another dimension time of the same instrument in a chart.

Thanks
joanNT is offline  
Reply With Quote
Old 02-25-2010, 11:20 AM   #12
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
Default

If you have added a smaller series to execute to like in our sample this could be the case...however when you plot the execution it will still be aligned with available timestamps of the bars.

NT7 will support MultiSeries charts, correct -

http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html
NinjaTrader_Bertrand is online now  
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
running all my symbols for strategy junkone Strategy Development 3 02-23-2010 08:41 AM
How to know the name of the strategy that is running richa61416 Strategy Development 2 02-19-2010 10:25 AM
Strategy arrows on chart thus no strategy is running poseidon_sthlm Strategy Development 2 01-15-2010 10:35 AM
Keep Strategy running. gator-trader Automated Trading 3 08-29-2009 06:26 PM
Keep Strategy Running CashCache Strategy Development 14 10-02-2008 11:20 PM


All times are GMT -6. The time now is 02:58 AM.