CS0102 - Already contains a definition for Gann Indicator - Dropdown box - NinjaTrader Programming | futures io social day trading
futures io futures trading


CS0102 - Already contains a definition for Gann Indicator - Dropdown box
Updated: Views / Replies:833 / 7
Created: by BChirhart Attachments:3

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
 

CS0102 - Already contains a definition for Gann Indicator - Dropdown box

  #1 (permalink)
Trading Apprentice
Omaha, NE
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 4 since Jun 2011
Thanks: 2 given, 1 received

CS0102 - Already contains a definition for Gann Indicator - Dropdown box

Hello all - Let me start by saying that I am new a C++ but have plenty of experience with Perl and Javascript, so programming isn't foreign to me... C++ is throwing me however.

I've created a new Gann indicator to look more like the one offered in ToS - This Gann indicator allows you to choose the period length, allows you to choose SMA or EMA, and colors the lines based on buy or sell indicators. The current Gann only plots the line from a 12 period SMA and only paints it gray. So I hope this is an improvement that others can use.

I do have an issue - All of the above works great, but the choice for SMA or EMA is just a simple string input in the properties. I am attempting to turn that in to a dropdown box and that is where I am getting held up. The dropdown box variable is set up as such:

// Wizard generated variables
private int lENGTH = 12; // Default setting for LENGTH
// User defined variables (add any user defined variables below)
private double vALUE_LOW = 1; // Default setting for VALUE_LOW
private double vALUE_HIGH = 1; // Default setting for VALUE_HIGH
private double SWING;
private MADROPDOWN MATYPE = MADROPDOWN.SMA;

#region Properties
[Description("Variable for Moving Average type")]
[Category("Parameters")]
public MADROPDOWN MATYPE
{
get { return mATYPE; }
set { mATYPE = value; }
}

public enum MADROPDOWN
{
EMA,
HMA,
SMA,
WMA,
}


Entire code is attached and I will also post the final code once fixed if someone wants to use it.

Attached Files
Register to download File Type: cs BDCGann3.cs (9.7 KB, 10 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)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,216 since Jun 2009
Thanks: 628 given, 6,314 received
Forum Reputation: Legendary



BChirhart View Post
...

Entire code is attached and I will also post the final code once fixed if someone wants to use it.

I think it's hard to remember which letter is capital why not just give it a numner

Attached Files
Register to download File Type: cs BDCGann3.cs (9.7 KB, 15 views)
Reply With Quote
The following 2 users say Thank You to cory for this post:
 
  #4 (permalink)
Trading Apprentice
Omaha, NE
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 4 since Jun 2011
Thanks: 2 given, 1 received


cory View Post
I think it's hard to remember which letter is capital why not just give it a numner

Works great - of course Cory. Thank you so much! Still a little confused however. Looks to me like you simply added 2 to the end of the MATYPE variable for all instances of that variable in the code. I guess I'm confused as to where the conflict was.

Reply With Quote
 
  #5 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,216 since Jun 2009
Thanks: 628 given, 6,314 received
Forum Reputation: Legendary


BChirhart View Post
Works great - of course Cory. Thank you so much! Still a little confused however. Looks to me like you simply added 2 to the end of the MATYPE variable for all instances of that variable in the code. I guess I'm confused as to where the conflict was.

my guess is it conflicts with sample indicator you imported.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Omaha, NE
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 4 since Jun 2011
Thanks: 2 given, 1 received


cory View Post
my guess is it conflicts with sample indicator you imported.

So each variable needs to be unique to ALL scripts?

Reply With Quote
 
  #7 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,216 since Jun 2009
Thanks: 628 given, 6,314 received
Forum Reputation: Legendary


BChirhart View Post
So each variable needs to be unique to ALL scripts?

check out good enum pratice here global namespace error already contains defination - NinjaTrader Support Forum

Reply With Quote
The following user says Thank You to cory for this post:
 
  #8 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary

I have posted a modified version of the Gann HiLo Activator here:

https://futures.io/download/ninjatrader-7/indicators/1223-download.html?view

It comes with 28 different moving averages, colors, arrows, paintbars and sound alerts.


Improved code efficiency

In order to improve code efficiency the stop line is not based on the current value of the moving average, but on the value 1 bar ago. This is a specific modification that is useful for intraday charts. In order to obtain real-time sound alerts, you need to run the indicator with the setting COBC (CalculateOnBarClose) = false. If you use the moving average of the current value, the moving average needs to be recalculated with every incoming tick. The stopline - that is the high average or low average depending on the trend - thus becomes a moving target. When price approaches the stopline, it moves away from price, which is an absolutely useless feature. Calculating the moving average from the prior n values of the high or low results in a stable stop line, which is only calculated once when the first tick of a bar is detected.

The HiLo Activator is just a special case of the SuperTrend, which is more versatile, as it allows you to increase or decrease the distance between stop line and price based on volatility. I therefore suggest not to use the Gann HiLo Activator but to use the SuperTrend instead, as it is a better tool.

Attached is a chart that compares the HiLo Activator with an adapted SuperTrend, which uses the bar median as input series and half the average bar range as offset.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > > CS0102 - Already contains a definition for Gann Indicator - Dropdown box

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
Gann Box in NinjaTrader msedlak40 NinjaTrader 5 December 5th, 2014 08:56 PM
Status Box OHLC Indicator Guss NinjaTrader 1 August 27th, 2013 09:49 PM
Gann HiLo Indicator cbritton TradeStation 2 July 30th, 2012 12:26 PM
Darvis Box Channel Indicator, help? hector24 NinjaTrader 2 July 5th, 2011 09:38 PM
Is there an indicator that will just display a box of a specific size? forrestang NinjaTrader 4 June 23rd, 2011 03:24 PM


All times are GMT -4. The time now is 09:53 PM.

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-12 in 0.12 seconds with 20 queries on phoenix via your IP 54.221.93.187