NexusFi: Find Your Edge


Home Menu

 





Help with completing very simple NT8 strategy.


Discussion in NinjaTrader

Updated
    1. trending_up 1,405 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 4 attachments




 
Search this Thread
  #1 (permalink)
tonybeans
Tampa Florida
 
Posts: 1 since Feb 2023
Thanks Given: 0
Thanks Received: 0

I am having trouble writing a very simple ninjatrader 8 strategy in the strategy builder.

I am trying to write it for instrument NQ on a 1000 tick chart, but would like this to be modified by the user to be able to select any instrument and any chart type/time frame

The parameters/conditions are;
Trading hours between 8 AM and 4 PM EST
Enter long position if tick bar close above 50 period SMA
Enter short position if tick bar close below 50 period SMA

inital profit target set at 120 ticks
initial stop loss set at 80 ticks
(I would like the user to adjust these profit target and stop loss values)

and I would like the strategy to not enter a new long until a short position is triggered (this is the part I am getting hung up on) right now I have been trying to write this strategy but after it hits profit target it enters a new long trade after that bar close because it is still above the 50 SMA and vice versa for the short side

I'd like the strategy to be able to "reset" itself so that it does not enter a new trade after profit target until it closes back over the other side of the 50 period SMA.

Any and all help would be greatly appreciated.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
$500M Riding on World Cup 2026: France/Spain Co-Favored …
Prediction Markets & Event Contracts
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
Expiration Day: Wall Street Rallies on Peace Hopes While …
Prediction Markets & Event Contracts
NYSE Owner ICE Invests in Crypto Exchange OKX at $25 Bil …
Cryptocurrency
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #2 (permalink)
 BERN Algos 
Bologna Italy
 
Experience: Advanced
Platform: nt8
Broker: NinjaTrader
Trading: futures
Posts: 58 since Jun 2022
Thanks Given: 12
Thanks Received: 54


tonybeans View Post
I am having trouble writing a very simple ninjatrader 8 strategy in the strategy builder.
...
and I would like the strategy to not enter a new long until a short position is triggered

Here you are, flip-flop fashion.








NOTE: I also tried to add dynamic StopLoss and TakeProfit (say, based on ATR) but this seems not allowed in the strategy builder:
https://forum.ninjatrader.com/forum/ninjatrader-8/strategy-development/1142876-stop-loss-and-profit-target-based-on-atr?p=1142942


Attached Files
Elite Membership required to download: FlipFLop.zip
Reply With Quote
Thanked by:




Last Updated on February 18, 2023


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts