Trading Articles
Article Categories
Article Tools
Need help for EMA slope startegy
Updated September 2, 2012
Top Posters
looks_one
Xav1029
with 2 posts (2 thanks)
looks_two
michaelf
with 2 posts (0 thanks)
looks_3
TraderSU
with 1 posts (1 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
trending_up
1,882 views
thumb_up
3 thanks given
group
2 followers
forum
5 posts
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)
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
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
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#3 (permalink )
Tampa, FL
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks: 1,452 given,
3,369
received
michaelf
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;
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.
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
Posts: 525 since Mar 2011
Thanks: 1,310 given,
554
received
TraderSU
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.
(login for full post details)
#6 (permalink )
Tampa, FL
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
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.
The following user says Thank You to Xav1029 for this post:
Last Updated on September 2, 2012
Right now
Ongoing
Right now
February
Coming soon
March
Register to Attend
Elite only