Need help for EMA slope startegy - futures io
futures io futures trading



Need help for EMA slope startegy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Xav1029 with 2 posts (2 thanks)
    2. looks_two michaelf with 2 posts (0 thanks)
    3. looks_3 TraderSU with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,882 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Need help for EMA slope startegy

(login for full post details)
  #1 (permalink)
Mérida, Mexico
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage
Trading: ES
 
michaelf's Avatar
 
Posts: 525 since Mar 2011
Thanks: 1,310 given, 554 received

Happy Jackson Hole Day to everybody, lol

I need some help to write a Strategy that plots vertical lines into a chart. I wrote everything with the Strategy Wizard and it is working, surprise! Now I would like to add a condition and with that one I have a problem. I would like an EMA with slope, for example 20 degree = flat. Flat = no plot.

What is the parameter to write that?

Thanks a lot
michael

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(167 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,375 since Dec 2011
Thanks: 1,452 given, 3,369 received



michaelf View Post
Happy Jackson Hole Day to everybody, lol

I need some help to write a Strategy that plots vertical lines into a chart. I wrote everything with the Strategy Wizard and it is working, surprise! Now I would like to add a condition and with that one I have a problem. I would like an EMA with slope, for example 20 degree = flat. Flat = no plot.

What is the parameter to write that?

Thanks a lot
michael

You couldn't really look at degrees for slope, because this would change based how zoomed in you were on the chart. You could add a plot, say myEMA was Plot[0].
Then add a variable for slope, say mySlope. mySlope would be ema value change over one bar.
Then
if(myEMA[0] - myEMA[1] <= mySlope && myEMA[0] - myEMA[1] >= -mySlope) PlotColors[0][0] = Color.Transparent;
else if(myEMA[0] - myEMA[1] > mySlope)PlotColors[0][0] = Color.Green;
else PlotColors[0][0] = Color.Red;

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Xav1029 for this post:
 
(login for full post details)
  #4 (permalink)
New York
 
Experience: Intermediate
Platform: NinjaTrader, Custom Platform
Broker: IB
Trading: ES, YM, Currency Futures
 
Posts: 79 since May 2010
Thanks: 46 given, 75 received

You can use the normalized slope. This is how I calculated the slope for ES on hourly chart.

 
Code
double _slope = Slope(_ema, 5); // this is slope per candle
double _slopeN = 24 * 100 * _slope / Close[0]; // slope in percent per day

// this assumes that 45 degree is 2% change in 4 days.
// change the multiplier as per your assumption
double _angle = 180 * Math.Atan(2 * _slopeN) / Math.PI;
Hope this helps.

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to TraderSU for this post:
 
(login for full post details)
  #5 (permalink)
Mérida, Mexico
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage
Trading: ES
 
michaelf's Avatar
 
Posts: 525 since Mar 2011
Thanks: 1,310 given, 554 received


TraderSU View Post
You can use the normalized slope. This is how I calculated the slope for ES on hourly chart.

 
Code
double _slope = Slope(_ema, 5); // this is slope per candle
double _slopeN = 24 * 100 * _slope / Close[0]; // slope in percent per day

// this assumes that 45 degree is 2% change in 4 days.
// change the multiplier as per your assumption
double _angle = 180 * Math.Atan(2 * _slopeN) / Math.PI;
Hope this helps.


Thank you, but I need do to it with the Strategy Wizard, I still don't understand how do write codes directely in the startegy.

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,375 since Dec 2011
Thanks: 1,452 given, 3,369 received

Search NT support forum for slope simple. Its a slope indicator, but I don't have the original anymore.

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Xav1029 for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Need help for EMA slope startegy


Last Updated on September 2, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts