Using slope of an indicator in an auto-strategy - NinjaTrader Programming | futures io social day trading
futures io futures trading


Using slope of an indicator in an auto-strategy
Updated: Views / Replies:3,386 / 4
Created: by nanobiotech Attachments:1

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Using slope of an indicator in an auto-strategy

  #1 (permalink)
Elite Member
Brisbane, Australia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL
 
nanobiotech's Avatar
 
Posts: 670 since Jun 2009
Thanks: 134 given, 428 received

Using slope of an indicator in an auto-strategy

I have a question for those amongst us that understand indicator code (I'm not too good at this yet) in order to access indicators in a strategy.

A nice example is the attached MASlopeBoxMulti indicator, which can display the slope of any of a good selection of moving average indicators.

My question is: how can the slope that is displayed on the chart be used as an entry or exit trigger in a strategy? How can we code for this in a strategy?

Cheers,
Nano

Attached Files
Register to download File Type: zip MASlopeBoxMulti.zip (31.3 KB, 149 views)
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,570 given, 3,982 received


In your .zip, a DataSeries is used to store the slope, but it's not always needed.
You can just use a variable, which stores the current slope, computed using the 3 previous values of the "thing" you want to apply/compute the slope.
For example, the slope of a EMA(20), in degrees:

 
Code
                            
//init

private int _ema20slope ;
...
// OnBarUpdate()
_ema20slope = (int)(180/Math.PI*(Math.Atan((EMA(20)[0]-(EMA(20)[1]+EMA(20)[2])/2)/1.5/TickSize)));
if (
_ema20slope 45) { golong();}
if (
_ema20slope < -45) { goshort();} 

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following 8 users say Thank You to sam028 for this post:
 
  #4 (permalink)
Elite Member
Brisbane, Australia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL
 
nanobiotech's Avatar
 
Posts: 670 since Jun 2009
Thanks: 134 given, 428 received


sam028 View Post
In your .zip, a DataSeries is used to store the slope, but it's not always needed.
You can just use a variable, which stores the current slope, computed using the 3 previous values of the "thing" you want to apply/compute the slope.
For example, the slope of a EMA(20), in degrees:

 
Code
                            
//init

private int _ema20slope ;
...
// OnBarUpdate()
_ema20slope = (int)(180/Math.PI*(Math.Atan((EMA(20)[0]-(EMA(20)[1]+EMA(20)[2])/2)/1.5/TickSize)));
if (
_ema20slope 45) { golong();}
if (
_ema20slope < -45) { goshort();} 

Sam, I'm seriously impressed. Thank you. I'll have a go.

Nano

Reply With Quote
The following user says Thank You to nanobiotech for this post:
 
  #5 (permalink)
Membership Revoked
United States of America
 
Futures Experience: Advanced
Platform: NT
 
Posts: 1,149 since Aug 2009
Thanks: 262 given, 471 received


nanobiotech View Post
Sam, I'm seriously impressed. Thank you. I'll have a go.

Nano

Sam is the best. A major assest and a true professional.

Reply With Quote

Reply



futures io > > > > > Using slope of an indicator in an auto-strategy

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aardvark auto strategy - based on Hurley nanobiotech Elite Automated NinjaTrader Trading 175 February 17th, 2014 03:46 PM
dmplus v3a is there a slope indicator? bobarian NinjaTrader 4 January 11th, 2013 12:09 PM
Custom NT indicator has stopped auto-loading with strategy, cache? drwylde NinjaTrader 1 July 9th, 2011 09:11 PM
Timed exit in auto strategy nanobiotech NinjaTrader Programming 2 December 28th, 2009 08:57 PM


All times are GMT -4. The time now is 03:59 AM.

Copyright © 2017 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
Page generated 2017-12-11 in 0.09 seconds with 20 queries on phoenix via your IP 54.226.113.250