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 > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-03-2010, 05:11 AM   #1
drolles
Senior Member
 
Join Date: Mar 2009
Posts: 292
Thanks: 12
Thanked 1 time in 1 post
Default Applying strategy to chart

Dear NT support,

I’m working with a colleague on a strategy. We are at the live testing a strategy.

I am having some problems with it. He is running it using IB’s feed into a SIM101 account. I am running it using E-signal’s live feed.

I am having problems when applying the strategy to a Chat window. The strategy appears to be processing the 1 min bars correctly when applied in the strategy tab. However, it doesn’t appear to be working or processing the bars correctly when applied to the chart.

I have checked that the chart has enough days included (I have now adjusted that to 50 – whereas the strategy only requires 32). Any other ideas of areas to check?

Additional information: It adds a additional timeframe of 1440 mins (simulate a day’s trading).

Thanks and regards,

Dan
drolles is offline  
Reply With Quote
Old 05-03-2010, 05:34 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Dan, are you testing on NT 65 or 7? On the charts in NT7 you would need to set 'enabled' to 'true' for it to start and process data.

Any errors in your log tab as it does not seem to work from a chart?

It showing as running then in the strategies if you'd loading it from the chart?

Are you both using the same min bars required settings? (the strategy would start trading if all series fulfill this criterion).
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-03-2010, 10:16 AM   #3
drolles
Senior Member
 
Join Date: Mar 2009
Posts: 292
Thanks: 12
Thanked 1 time in 1 post
Default

Bertrand,

Thanks for your reply.

I am using 6.5 as NT 7 is still in beta.

I am seeing no errors in any of the logs. I have also attached Visual Studio to NT and am not seeing an logic errors thrown.

I have just been working with my colleague against the live market and the strategy has been taking positions with his IB account whereas it hasn’t with mine.

I have made adjustments to the min bar required as I have had problems with this before. I have inserted these checks into the code, which I have used successfully with other strategies.



Code:
  

if (CurrentBar <= 35)
                    return;
and


in the primary timeframe

Code:
if (BarsArray[1].CurrentBar <= 35)
return;
Thanks and regards,


Dan
drolles is offline  
Reply With Quote
Old 05-03-2010, 10:28 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Thanks Dan, have you tried simplifying to see where the issue might be? For example if you comment out the added daily frame logic, does it change the behavior then? If you add the daily and have the bars check for 35 bars, then you would not have sufficient data likely loaded with your stated amount in the first post, so I suspect this is the issue likely here.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-03-2010, 10:43 AM   #5
drolles
Senior Member
 
Join Date: Mar 2009
Posts: 292
Thanks: 12
Thanked 1 time in 1 post
Default

Bertrand,

Thanks very much for your reply.

I have commented out large chunks of code, this doesn’t appear to help.

I have tried to adding sufficient data (e.g. setting Min bars required to 40) this does not work either.

Kind regards,

Dan
drolles is offline  
Reply With Quote
Old 05-03-2010, 10:48 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Dan, thanks - hmm then I would add Prints to the various code sections to see what is called and what not, so you could then proceed from there. Is the strategy worked on your friends PC using your eSignal? This way we could exclude the connection then...if you like I could run this on my eSignal here as well and see if I can reproduce this behavior.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-03-2010, 04:20 PM   #7
drolles
Senior Member
 
Join Date: Mar 2009
Posts: 292
Thanks: 12
Thanked 1 time in 1 post
Default

Bertrand,

Thanks again for your reply.

We might have to take you up on your offer to run it against a chart at your end.

I have now got it running against the crosses what appears to be successfully within the strategy tab (after some modifications to the code). However, we can’t cannot getting it running when applied to a chart.

Should I forward a copy of the code though to the support mailbox?

Thanks and regards,

Dan
drolles is offline  
Reply With Quote
Old 05-03-2010, 04:54 PM   #8
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

Hi Dan,

That would be great. If you send to support@ninjatrader.com, be sure to reference this thread:
http://www.ninjatrader-support2.com/...ad.php?t=28796
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-17-2010, 12:18 AM   #9
drolles
Senior Member
 
Join Date: Mar 2009
Posts: 292
Thanks: 12
Thanked 1 time in 1 post
Default

Ryan / Bertrand,

Thanks very much for your continued support.

Good news. I’ve managed to fix this. Though, it was a funny one. Our strategy requires about 30 days (1440) of min data. I had been setting the charts to bring in 40 days to be sure we had enough data on the chart. In work this weekend I’ve set the chart to 60 days and it started to work. I’m not really sure was is happening there; 40 days should have been sufficient.

Thanks and regards,

Dan
drolles is offline  
Reply With Quote
Old 05-17-2010, 04:12 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Dan, great to hear - I could only explain this by your min bars required setting, as for 1440 mins a default setting of 20 would be essentially 20 days before the strategy would start processing, if you add your custom need of 30 to this, you end up with a min of 50 days needed.
NinjaTrader_Bertrand 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
Error Message when Applying Template FatCanary Version 7 Beta General Questions & Bug Reports 13 12-04-2009 05:10 PM
Applying TradeBullet to NT tooearly Connecting 4 08-05-2009 09:24 AM
Applying Strategies heyligerb Automated Trading 3 05-06-2009 05:42 AM
Applying indicators to a chart (for backtestring). strategy1 Charting 7 07-26-2008 11:21 PM
Applying Stochastics to SMA jeremymgp Indicator Development 1 12-03-2007 11:37 PM


All times are GMT -6. The time now is 12:56 PM.