Advise or guidance needed for an alternative to enum - NinjaTrader Programming | futures io social day trading
futures io futures trading


Advise or guidance needed for an alternative to enum
Updated: Views / Replies:1,397 / 5
Created: by kaywai 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
 

Advise or guidance needed for an alternative to enum

  #1 (permalink)
Trading for Fun
singapore
 
Futures Experience: Intermediate
Platform: ninjatrader
Broker/Data: IB
Favorite Futures: ES, forex, oil
 
Posts: 131 since Nov 2009
Thanks: 11 given, 7 received

Advise or guidance needed for an alternative to enum

Hi, I came across some code for an indicator in ninjatrader which uses enum values.

You can either select a buy indicator or a sell indicator but you can't have both on the same chart at the same time.

I would like to find an alternative to using enum or enhance enum functionality so that i can use both the buy and sell indicator at the same time. Essentially, the code for the buy and sell is the same except that the buy uses close[0]<close[4] and the sell uses close[0]>close[4], the key being "<" and ">".

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)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


Without posting the code, there is really no helping you. Sorry.

For example, an alternative to enum could be an int. That isn't helpful.

Post the code.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #4 (permalink)
 Vendor: www.traderwerks.com 
Taipei Taiwan
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Optimus
Favorite Futures: TW
 
Posts: 693 since Jun 2009
Thanks: 440 given, 440 received


kaywai View Post
Hi, I came across some code for an indicator in ninjatrader which uses enum values.

You can either select a buy indicator or a sell indicator but you can't have both on the same chart at the same time.

I would like to find an alternative to using enum or enhance enum functionality so that i can use both the buy and sell indicator at the same time. Essentially, the code for the buy and sell is the same except that the buy uses close[0]<close[4] and the sell uses close[0]>close[4], the key being "<" and ">".

Don't think enum is the problem. You will need to change the code. How you represent the selection ( enum, int, string ) is not really that important.

By the way, the default underlying type of the enumeration elements is int.

Reply With Quote
 
  #5 (permalink)
Trading for Fun
College Point, NY (Queens)
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG
Favorite Futures: YM
 
Posts: 63 since Nov 2009
Thanks: 5 given, 20 received


kaywai View Post
Hi, I came across some code for an indicator in ninjatrader which uses enum values.

You can either select a buy indicator or a sell indicator but you can't have both on the same chart at the same time.

I would like to find an alternative to using enum or enhance enum functionality so that i can use both the buy and sell indicator at the same time. Essentially, the code for the buy and sell is the same except that the buy uses close[0]<close[4] and the sell uses close[0]>close[4], the key being "<" and ">".

If you're going to show both buy and sell at the same time, this implies (according to your analysis) that close[0] can be both < and > close[4] at the same moment. Perhaps this is why it's disallowed. Good luck.

Btw, as other posters noted ... an enum is really a set of ints. It's just a notation device to make comparisons, etc easier and more meaningful for readers of the code.

You might try something like the following ...

const int Buy = 1, Sell = 2, BuyAndSell = 3;

...

Side = Sell;

switch ( Side )
{
case Buy:
// Do something
break;

case Sell:
// Do Something else.
break;

case BuyAndSell:
Print( "Illegal action.\n");
break;

}


Last edited by kandlekid; February 4th, 2010 at 04:58 AM.
Reply With Quote
The following user says Thank You to kandlekid for this post:
 
  #6 (permalink)
Trading for Fun
singapore
 
Futures Experience: Intermediate
Platform: ninjatrader
Broker/Data: IB
Favorite Futures: ES, forex, oil
 
Posts: 131 since Nov 2009
Thanks: 11 given, 7 received

I've attached the whole code. To be honest, if I could use an alternative to enum is probably the way to go though you need something to let it know that you are on a BUY count or SELL count. While they cannot happen (the BUY & SELL) together, displaying them on the chart at the same time is very useful as some trades can be identified that way...


Attached Files
Register to download File Type: zip TDSequential.zip (9.2 KB, 19 views)
Reply With Quote

Reply



futures io > > > > > Advise or guidance needed for an alternative to enum

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
Trade management guidance needed.... tradersam Psychology and Money Management 14 June 10th, 2011 11:20 AM
Small Caps Have Upside, but Market Pros Advise Caution Quick Summary News and Current Events 0 December 24th, 2010 07:40 PM
Collective2 alternative for NinjaTrader? molecool NinjaTrader Programming 13 September 25th, 2010 03:44 PM
Frequency distribution guidance request - help ! Eric j Traders Hideout 9 June 19th, 2010 11:30 AM


All times are GMT -4. The time now is 06:17 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-15 in 0.08 seconds with 20 queries on phoenix via your IP 107.20.115.174