Want to create an indicator and have no idea where to start? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Want to create an indicator and have no idea where to start?
Updated: Views / Replies:11,043 / 93
Created: by forrestang Attachments:30

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
 30  
 
Thread Tools Search this Thread
 

Want to create an indicator and have no idea where to start?

  #81 (permalink)
Elite Member
Lagos, Nigeria
 
Futures Experience: Intermediate
Platform: NinjaTrader, SierraChart
Favorite Futures: Euro Currency & Oil
 
lolu's Avatar
 
Posts: 2,440 since Jun 2009
Thanks: 1,000 given, 1,595 received


forrestang View Post
Yep. That's the plan.

Can backtesting only be done via strat?

Do we have the updated indicator version of your Strat posted ?

Lolu

Reply With Quote
 
  #82 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


lolu View Post
Do we have the updated indicator version of your Strat posted ?

Lolu

If you want to play with it, try this out and let me know if it imports. It's not where I wanted it to be, if I ever finish, I'll post this in the download section or something.

Some notes though:
  • This contains the indie and the strat
  • If you downloaded the original I posted, overwrite them on import since I had to modify the original
  • My strat/indie calls on the original indicators, so if you want to change any of the default values in the original, you have to manually go in and change them in the ORIGINAL indie script itself to get it to reflect in my strat/indie
  • The ERG_Str, I have modified the original values shipped with it, so if you want to change it back, change the "Base Prime" back to 7
  • The ERG_Trade I modified the "SFactor" from the original of 0.5 to 0.25

Attached Files
Register to download File Type: zip Prof_Indicator_Strat.zip (59.8 KB, 37 views)

Last edited by forrestang; June 8th, 2011 at 05:21 PM.
Reply With Quote
The following 3 users say Thank You to forrestang for this post:
 
  #83 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,220 since Jun 2009
Thanks: 628 given, 6,318 received
Forum Reputation: Legendary


overwrite option doesnt work but delete all three ERG indis then import strategy works.

Reply With Quote
The following user says Thank You to cory for this post:
 
  #84 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received

Hello forrestang. I just found your thread -- it looks like this all started while I was out of town. I certainly do not want to derail your programming learning experience. I think that Prof Schamp would have referred you to me if you asked him about how to read the code as I wrote these Ninjatrader indicators for him.

FYI, I just sent him an updated version as I have been working on a wrapper indicator that diagrams his Office entry & exit rule set. However, since it appears that you modified the indicators, that probably does not matter now. I hope you renamed the indicators when you changed the code to avoid confusion with his supported indicators?

good trading!

Reply With Quote
 
  #85 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


LostTrader View Post
Hello forrestang. I just found your thread -- it looks like this all started while I was out of town. I certainly do not want to derail your programming learning experience. I think that Prof Schamp would have referred you to me if you asked him about how to read the code as I wrote these Ninjatrader indicators for him.

FYI, I just sent him an updated version as I have been working on a wrapper indicator that diagrams his Office entry & exit rule set. However, since it appears that you modified the indicators, that probably does not matter now. I hope you renamed the indicators when you changed the code to avoid confusion with his supported indicators?

good trading!

I definitely wished you had found this thread as it seems you were JUST the person I was looking for LOL. I'll be looking forward to your further comments.

As far as renaming, I DID NOT. I planned to, and that was one of the reasons I wanted to release a bit latter, and figured not many would be using my indicator. But..... the only change I made to the original code really was adding another exposed dataSeries/Variable, which was the "Long Term Strength." Everything else I needed to create MY indicator was already exposed and readily available. I named this variable "lts()"

In your next update, if you could add that simple portion to add that dataSeries in the "exposed variables", it would be helpful, as then everything one would use to replicate the "Office Setups" would be there outwardly accessible to anyone wanting to manipulate things based on the indicators you have created.

Also, my indicator can't be passed any modified user inputs of the original indies, so to make changes in what my indy/strat does (such as changing the base prime), one has to manually go inside the original script of the indies and modify them there to take affect in my study.

Also had you noticed how I set mine up, kind of like a switch board where I can toggle each trade location of the "Office Setups?" So if you only want trades beyond prime, or 0, one can toggle that trade per the office setups.

The format I wrote was like "1c_ABC." Where "1c" references the office setup number. The "ABC" refers to the location of the trade. Strength in quadrant A, Trading ERG in quadrant B, and Trading Histogram in quadrant C. So there are 64 combinations of "1c" trades:
1c_AAA
1c_AAB
1c_AAC
.
.
.
.
1c_DDD

Initially I wanted to test the expectancy of various trade locations, I don't know if one needs that level of detail, but I thought I'd build it in anyway. I took what was probably a very laborious way of scripting this though as you can see.

Reply With Quote
 
  #86 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received


Quoting 
But..... the only change I made to the original code really was adding another exposed dataSeries/Variable, which was the "Long Term Strength." Everything else I needed to create MY indicator was already exposed and readily available. I named this variable "lts()"

That's interesting - I just went and looked and it is exposed. So that probably happened between the version you used and the latest.
 
Code
[Browsable(false)]    
        [XmlIgnore()]        
        public int LTS
        {
            get { Update(); return dirLTS[0]; }
        }
I have not examined yours yet. I meant to work today and instead have spent all morning reading futures.io (formerly BMT)'s forums! So much for getting work done!

Actually you can pass changes to exposed variables if they are writable. I'll post some examples. The code is different for Indicator vs Strategy. Since you are now writing a Strategy, I'll pull those samples.

Reply With Quote
 
  #87 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received

This is especially important in Strategies, where you want to ensure that the indicators are using what the Strategy expects. So the Strategy has its own Input variables that are used to set the called Indicators up correctly.

 
Code
#region Variables
private Indicator.ERG_Trade    T_ERG;
private Indicator.ERG_Str1    S_ERG;            
private Indicator.ERG_Trig    E0_ERG;
Initialize()
 
Code
            // -----------------------  Trade
            T_ERG = ERG_Trade(Input);              
            Add( T_ERG );
            // -----------------------  Strength
            S_ERG = ERG_Str1(Input); 
            Add( S_ERG );
            // -----------------------  Timing Trigger
            E0_ERG = ERG_Trig(Input);
OnStartUp()
 
Code
            // -----------------------  Trade            
            T_ERG.BasePrime = basePrime;     T_ERG.M3 = m3;    
            T_ERG.Conf_Reqd = false;
            T_ERG.SCount = sCount; T_ERG.SFactor = sFactor; T_ERG.Enable_T3 = enT3;
            T_ERG.Enable_LTSBarColor = true;
            // -----------------------  Strength
            S_ERG.BasePrime = basePrime; 
            S_ERG.Conf_Reqd = false;
            S_ERG.MinHist = minHIST2;
            // -----------------------  Timing Trigger
            E0_ERG.BasePrime = BasePrime;  
            E0_ERG.Conf_Reqd = false;
// Indicator Input Variables
 
Code
        [Description("Common Denominator of Chart settings (7)")]
        [GridCategory("ERG_Common Parameters")]
        public int BasePrime
        {
            get { return basePrime; }
            set { basePrime = Math.Max(1, value); }
        } 
        [Description("Smoothing Count, typically 3 through 7")]
        [GridCategory("ERG_Trading Parameters")]
        public int SCount
        {
            get { return sCount; }
            set { sCount = Math.Max(1, value); }
        }        
        [Description("Smoothing Factor = damping coefficient for T3 filter")]
        [GridCategory("ERG_Trading Parameters")]
        public double SFactor
        {
            get { return sFactor; }
            set { sFactor = value; }
        }    
        [Description("Smoothing Method = T3 (may be slower)")]
        [GridCategory("ERG_Trading Parameters")]
        [NinjaTrader.Gui.Design.DisplayName("Use T3")]
        public bool Enable_T3
        {
            get { return enT3; }
            set { enT3 = value; }
        }    
        
        [Description("minimum change required for Strength Histogram color change")]
        [GridCategory("ERG_Strength Parameters")]
        public double MinSTRHist
        {
            get { return minHIST2; }
            set { minHIST2 = Math.Max(0, value); }
        }

Reply With Quote
The following 2 users say Thank You to LostTrader for this post:
 
  #88 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


LostTrader View Post
That's interesting - I just went and looked and it is exposed. So that probably happened between the version you used and the latest.

Hmmm, that was there. I guess I just didn't know how to reference it properly?

Reply With Quote
 
  #89 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received


forrestang View Post
Hmmm, that was there. I guess I just didn't know how to reference it properly?

Because it is a dir variable, it is like the others (AKA Slope) in that >0 is up, long, rising, etc and <0 is down, short, falling... 0 is flat or undefined (never set). Unlike the other dir (Slope) it is just the current value, so a single integer, not an IntSeries.

Reply With Quote
 
  #90 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received



LostTrader View Post
FYI, I just sent him an updated version as I have been working on a wrapper indicator that diagrams his Office entry & exit rule set.

Can you explain what this means as well? What do you mean by "wrapper indicator?"

Reply With Quote

Reply



futures io > > > > > Want to create an indicator and have no idea where to start?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a Programmer that can create this Congestion Indicator nillz123 NinjaTrader 9 December 28th, 2013 01:19 PM
Simple Divergence and Stop Box Indicator Idea! tdaman Platforms and Indicators 5 May 16th, 2011 09:44 AM
want to create a new indicator. joyginy NinjaTrader Programming 5 January 18th, 2010 06:52 PM
Create this indicator Zoethecus NinjaTrader Programming 16 November 16th, 2009 07:56 PM
trying to create a Trend Line Rejection Indicator Eric NinjaTrader Programming 5 October 27th, 2009 03:45 PM


All times are GMT -4. The time now is 04:23 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-17 in 0.14 seconds with 20 queries on phoenix via your IP 54.227.51.103