Please see the forum section, " Reference Samples "http://www.ninjatrader.com/support/forum/forumdisplay.php?f=30 that provide sample coding for a variety of conditions.
In your particular case I think "Halting a strategy once user defined conditions are met" is what would be helpful here: http://www.ninjatrader.com/support/f...ead.php?t=4804
Comment