Help : Method + Switch - futures io
futures io futures trading



Help : Method + Switch


Discussion in NinjaTrader

Updated by wkmetal
    1. trending_up 2,356 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 3 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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)

 
Search this Thread
 

Help : Method + Switch

(login for full post details)
  #1 (permalink)
HK
 
Experience: Intermediate
Platform: NinjaTrader
 
Posts: 2 since Aug 2009
Thanks: 1 given, 1 received

hello
any expert kind to point me the code :
method + switch (method)

example:

private bool abc()
{ return (
switch (expression)
{
case 1: if ( xy() ) {return true;} break;
case 2: if ( yz() ) {return true;} break;

}
)
}
===============
where xy() and yz() are bool

thanks a lot

Reply With Quote

Can you help answer these questions
from other members on futures io?
NinjaTrader Applications Rejected
Brokers
Trade Summary Error
MultiCharts
Degiro Negative Balance Advice
Traders Hideout
3x Fangdango
Traders Hideout
Thinkscript for scanning in Option Hacker
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
VWAP for stock index futures trading?
39 thanks
Coronavirus COVID-19
19 thanks
Price Action Kewltech Style
11 thanks
Battlestations: Show us your trading desks!
9 thanks
The CL Crude-analysis Thread
9 thanks
 
(login for full post details)
  #3 (permalink)
Taipei Taiwan
 
Experience: Advanced
Platform: NinjaTrader
Broker: AMP Clearing
Trading: TW
 
Posts: 693 since Jun 2009
Thanks: 434 given, 455 received



wkmetal View Post
hello
any expert kind to point me the code :
method + switch (method)

example:

private bool abc()
{ return (
switch (expression)
{
case 1: if ( xy() ) {return true;} break;
case 2: if ( yz() ) {return true;} break;

}
)
}
===============
where xy() and yz() are bool

thanks a lot

我不懂你的邏輯。你要不要這樣子嗎?

 
Code
                 switch (expression)
                              {
                                 case 1: if ( xy() ) {ret = true;} break;
                                 case 2: if ( yz() ) {ret = true;} break;
				default: $ret = false ;
                                }
	return ret ;
And using default is also a good idea.

Reply With Quote
The following 2 users say Thank You to traderwerks for this post:
 
(login for full post details)
  #4 (permalink)
HK
 
Experience: Intermediate
Platform: NinjaTrader
 
Posts: 2 since Aug 2009
Thanks: 1 given, 1 received

hi,
many thanks your reply, yes, as you said , i must figure my logic first
but your suggestion seem work for me. you are number one

Reply With Quote
The following user says Thank You to wkmetal for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Help : Method + Switch


October 25, 2010


Upcoming Webinars and Events
 

An Afternoon With futures io member TropicalTrader

Elite only
     



Copyright © 2020 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