![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Dec 2007
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Dec 2007
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Dec 2007
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |