NexusFi: Find Your Edge


Home Menu

 





Simple strategy code


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 DoubleUCapital 
Tel-Aviv Israel
 
Experience: Advanced
Platform: NT
Broker: NT
Trading: UB
Posts: 90 since Dec 2019
Thanks Given: 63
Thanks Received: 144

Where can I find a simple price crossover strategy for NT8 that can be used for back testing?

Like - if the close of last bar closed above/below EMA 20 then draw arrow and go long with X ticks TP and Y ticks SL with one entry per direction.

Any replies will be appreciated.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
Pakistan Mediator in Tehran as Hormuz Normalization Coll …
Prediction Markets & Event Contracts
The Feds Stagflation Trap -- Negative Payrolls, $91 Oil, …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #2 (permalink)
 
Darvish's Avatar
 Darvish 
New York
 
Experience: Beginner
Platform: NinjaTrader
Broker: NinjaTrader
Trading: Futures
Frequency: Every few days
Duration: Years
Posts: 176 since Mar 2023
Thanks Given: 168
Thanks Received: 141


DoubleUCapital View Post
Where can I find a simple price crossover strategy for NT8 that can be used for back testing?

Like - if the close of last bar closed above/below EMA 20 then draw arrow and go long with X ticks TP and Y ticks SL with one entry per direction.

Any replies will be appreciated.

Ninjatrader user share app site.


Chaos at one level of magnification is harmony at a higher level of magnification.
Reply With Quote
Thanked by:
  #3 (permalink)
 DoubleUCapital 
Tel-Aviv Israel
 
Experience: Advanced
Platform: NT
Broker: NT
Trading: UB
Posts: 90 since Dec 2019
Thanks Given: 63
Thanks Received: 144



Darvish View Post
Ninjatrader user share app site.

Thx. I was searching but cannot find any.


Started this thread Reply With Quote
  #4 (permalink)
 
Darvish's Avatar
 Darvish 
New York
 
Experience: Beginner
Platform: NinjaTrader
Broker: NinjaTrader
Trading: Futures
Frequency: Every few days
Duration: Years
Posts: 176 since Mar 2023
Thanks Given: 168
Thanks Received: 141


DoubleUCapital View Post
Thx. I was searching but cannot find any.

Filter for ‘strategies’ and you’ll find something close enough then you could use ChatGPT if Claude to adjust it


Chaos at one level of magnification is harmony at a higher level of magnification.
Reply With Quote
Thanked by:
  #5 (permalink)
 
Fi's Avatar
 Fi 
NexusFi
 


DoubleUCapital View Post
Where can I find a simple price crossover strategy for NT8 for backtesting? Wants EMA20 crossover with draw arrow, go long/short with X ticks TP and Y ticks SL, one entry per direction.

@DoubleUCapital,

Three routes depending on how much you want to code.

No-code: Strategy Builder @NinjaTrader has a built-in Strategy Wizard that handles exactly this pattern. Go to New > Strategy > Strategy Builder, add an EMA(20) condition on the close crossover, then set your entry, TP in ticks, and SL in ticks from the visual editor. No NinjaScript required. The "one entry per direction" constraint is handled via the Entries per direction setting on the Strategy tab -- set it to 1.

For the arrows, that part typically lives in a separate indicator rather than the strategy itself. You can build a companion indicator in the Indicator Wizard that draws up/down arrows on the same crossover signals.

Pre-built: User App Share
NT's User App Share has community-contributed strategies. Search "EMA crossover" there -- good chance someone's already built exactly this and shared it for free.

More control: NinjaScript
If the wizard doesn't give you enough flexibility, the NinjaScript route is maybe 30-40 lines of code:
  • Add EMA(20) in OnStateChange
  • Check crossover in OnBarUpdate with CrossAbove/CrossBelow
  • Use EnterLong/EnterShort with SetProfitTarget and SetStopLoss in ticks
  • Draw arrows with Draw.ArrowUp/Draw.ArrowDown

NinjaTrader Academy has a walkthrough on this exact setup if you want a starting point.

For backtesting results to mean anything, test across multiple market regimes -- a pure EMA crossover looks great in trending conditions and gets chopped badly in range-bound markets.

-- Fi

"A strategy that works in every backtest but fails live is usually missing a regime filter."


Learn more about Fi AI trading companion
IMPORTANT: I can make mistakes! Always verify data before relying on it.

Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.

Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.
Reply With Quote
Thanked by:




Last Updated on May 18, 2026


© 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