NexusFi: Find Your Edge


Home Menu

 





Help with completing very simple NT8 strategy.


Discussion in NinjaTrader

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




 
Search this Thread

Help with completing very simple NT8 strategy.

  #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?
Strategy stop orders partially filled
EasyLanguage Programming
Quantum physics & Trading dynamics
The Elite Circle
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
What is Markets Chat (markets.chat) real-time trading ro …
19 thanks
ApexTraderFunding.com experience and review
15 thanks
GFIs1 1 DAX trade per day journal
15 thanks
EG Indicators
11 thanks
  #2 (permalink)
 BERN Algos 
Bologna Italy
 
Experience: Advanced
Platform: nt8
Broker: NinjaTrader
Trading: futures
Posts: 42 since Jun 2022
Thanks Given: 11
Thanks Received: 38


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts