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 07-18-2008, 12:16 PM   #1
tony900hwk
Member
 
Join Date: Dec 2007
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default CrossBelow and Compiled Strategies

Hello. I have two questions. When am about to start back testing a strategy and I select it from the drop down box I see that there are other old strategies that I do not use anymore in the list. Is there a way to remove them from the list?

My second question involves the CrossBelow and CrossAbove. I sell on a crossbelow of moving averages among some other conditions, but on the trade last night, the moving averages didn't actually cross. Do you know what went wrong? Is there a way to fix this? I have tried to include an attachment of the picture.

Thanks
Attached Images
File Type: jpg untitled.JPG (22.9 KB, 21 views)
tony900hwk is offline  
Reply With Quote
Old 07-18-2008, 05:14 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

1) Tools > Edit NinjaScript > Strategy > Select the strategy you wish to remove and press the "Delete" button

2) You likely ran your strategy with 'Calculate on bar close" set to false, sometime during the bar the cross occured which triggered your logic but on the bar close, it was not crossed.
NinjaTrader_Ray is offline  
Reply With Quote
Old 07-18-2008, 11:01 PM   #3
tony900hwk
Member
 
Join Date: Dec 2007
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default

Sorry I was not clear on the first question. I have deleted the strategy from the menu that you mentioned, but the strategy name is still in the drop-down list of choices. Also, if I try to compile a strategy with the name of the old deleted strategy I get the error that there is already a definition for that name.

As for the second question, the goal is to run the entry code at the close of each 15 min bar and then run position management with each incoming tick. If I set CalculateOnBarClose to true, use 15 min as the main data series, and add tick data to the code, would using BarsInProgress make this idea work?
tony900hwk is offline  
Reply With Quote
Old 07-18-2008, 11:30 PM   #4
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

1) You will need to double check again for your strategy. If it is still referencing it it is still there somewhere. Look around. Recompile something. It has to be there somewhere.

2) That would work or you could try just using an if statement bracket with the condition if (FirstTickOfBar) to run around your orders. Please take note that if you run FirstTickOfBar you want to reference everything back one. So you want to reference Close[1] instead of Close[0] for the most recently closed bar. Then if you are running limit or stop orders you will probably want to set them to liveUntilCancelled = true.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-18-2008, 11:46 PM   #5
tony900hwk
Member
 
Join Date: Dec 2007
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default

I thought that the script files all had to be in the one particular folder. I found the file in another folder. Thank you for your help. I also just want to say that I love ninjatrader and you guys provide great support. I really appreciate it.
tony900hwk 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
Can Strategies be 'compiled'? cassb Strategy Development 1 05-01-2008 08:49 AM
Custom Enum can be compiled in 6.0, but not in 6.5 ooppie General Programming 3 04-24-2008 02:27 AM
Correct argument passing, CrossBelow, Stochastics MarkBN General Programming 3 04-16-2008 07:06 AM
No CrossAbove/CrossBelow condition for alerts? Elliott Wave Market Analyzer 1 04-11-2008 01:39 PM
CrossBelow previous bar and omit current bar ct General Programming 1 06-03-2007 02:54 AM


All times are GMT -6. The time now is 01:28 AM.