NexusFi: Find Your Edge


Home Menu

 





EMA spread - how and where to start


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 micasa001 
Amsterdam
 
Experience: Master
Platform: Own
Trading: Currency
Posts: 9 since Jul 2017
Thanks Given: 4
Thanks Received: 1

Hi all,

I was working for a long time on TradingView but prefer the features NinjaTrader is giving. Now Im trying to start to add a simple EMA spread script as an indicator but lost already

What Im trying to do is to get a similar script as I use in Tradingview like this.

 
Code
sell_value = input(2)
buy_value = input(-2)
ema1_speed_fast = input(50)
ema1_speed_slow = input(50)

ema2_speed_fast = input(13)
ema2_speed_slow = input(34)


fastema1=ema(close,ema1_speed_fast)
slowema1=ema(close,ema1_speed_slow)
e=(fastema1/slowema1-1)*100

fastema2=ema(close,ema2_speed_fast)
slowema2=ema(close,ema2_speed_slow)
f=(fastema2/slowema2-1)*100

//plot(0, color=#404040, title="Zero value")
plot(buy_value, color=green, linewidth=2, title="Buy value")
plot(sell_value, color=red, linewidth=2, title="Sell value")
plot(e, color=red, linewidth=2, title="EMA spread 1")
plot(f, color=blue, linewidth=2, title="EMA spread 2")
I tried the code editor but the only result I get every time is errors so I have to remove the script again and get frustrated... After a day of work I hope someone can help me a bit in the good direction how to start with this simple code, maybe have a good similar example?

Best regards,


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
South Korea Suspends Bithumb for Six Months Over AML Fai …
Cryptocurrency
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
Tradeify 3.0 Overhauls Futures Prop Firm Model -- One-Ti …
Funded Trading Evaluation Firms
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #2 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093

it will help if you include a picture of what it looks like. dif between MAs is how MACD calculated so you can open NT MACD script, make a copy then modify it any way you want.


Reply With Quote
Thanked by:
  #3 (permalink)
 micasa001 
Amsterdam
 
Experience: Master
Platform: Own
Trading: Currency
Posts: 9 since Jul 2017
Thanks Given: 4
Thanks Received: 1



cory View Post
it will help if you include a picture of what it looks like. dif between MAs is how MACD calculated so you can open NT MACD script, make a copy then modify it any way you want.

Nice idea. Thanks. Let me start on that.


Started this thread Reply With Quote
  #4 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
Legendary Urban Samurai
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,345 since Jun 2010
Thanks Given: 357
Thanks Received: 1,060

LINK


Reply With Quote
Thanked by:




Last Updated on January 13, 2021


© 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