![]() |
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 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Hello
I am trying to implement something in the code which I thought would be somewhat simple, i.e. if ('condition 1' && 'condition 2' && 'condition 3' && BarsSinceExit() > 0) EnterShort() Basically when entering the 'BarsSinceUpdate()' command I get zero orders executed.....removing this line & things go back to normal. Clearly the code I have is a little more complicated than the above, but the principle is the same. Any ideas as to where I could be going wrong? thx David |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Unfortunately we are unable to review actual strategies for bandwidth reasons. NinjaScript consultants are available to help program your custom indicators/strategies or to help our users throughout their learning curve. Additional information is located here: http://www.ninjatrader.com/webnew/pa...injaScript.htm
Here is a quick hint: As I "hit the wall" on some unexpected strategy behavior I usually try to isolate the cause of trouble by building a "simple as possible" variation of my strategy to see if that works as expected. As it does, I add condition by condition to locate where my logic (or the NT framework ?!?) breaks. In your case I would start and try something like Print (BarsSinceEntry()) to see if you get the results you would expect.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Just a hunch. Maybe try BarsSinceExit() >= 1? That shouldn't make a difference though hmm. No errors in logs?
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|