Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Search the Community

Showing results for tags 'switch'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to Traders Laboratory
    • Beginners Forum
    • General Trading
    • Traders Log
    • General Discussion
    • Announcements and Support
  • The Markets
    • Market News & Analysis
    • E-mini Futures
    • Forex
    • Futures
    • Stocks
    • Options
    • Spread Betting & CFDs
  • Technical Topics
    • Technical Analysis
    • Automated Trading
    • Coding Forum
    • Swing Trading and Position Trading
    • Market Profile
    • The Wyckoff Forum
    • Volume Spread Analysis
    • The Candlestick Corner
    • Market Internals
    • Day Trading and Scalping
    • Risk & Money Management
    • Trading Psychology
  • Trading Resources
    • Trading Indicators
    • Brokers and Data Feeds
    • Trading Products and Services
    • Tools of the Trade
    • The Marketplace
    • Commercial Content
    • Listings and Reviews
    • Trading Dictionary
    • Trading Articles

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


First Name


Last Name


Phone


City


Country


Gender


Occupation


Biography


Interests


LinkedIn


How did you find out about TradersLaboratory?


Vendor


Favorite Markets


Trading Years


Trading Platform


Broker

Found 1 result

  1. This thread is about the EasyLanguage keywords Switch and Case. Switch/Case (EasyLanguage) Reserved word used to transfer control to an associated Case or Default statement. Syntax Switch ( expression ) Begin Case case-expression: statements; Default: statements; End; Control passes to the statements whose case-expression matches the value of the switch ( expression ). The switch statement can include any number of case instances, but no two case constants within the same switch statement can have the same constant value. Note Once the statements associated with a matching case are evaluated, control passes to the end of the switch statement. This is an implied break and is different than a similar structure found in some other languages that require an explicit break. Remarks A single case statement can carry multiple values, as the following example shows: Case 1, 2, 3, 4, 5, 6, 20: Value1 = Lowest(Close,3); Ranges like this are also valid: Case 1 to 6, 20: Value2 = Highest(High,5); In both of the above examples, if case-expression equals any number between 1 and 6 or equal to 20, a function is called and assigned to a value. In addition, logical operators may be used with case statements including: >, <, >=, <=, <> and =. Case > Average( Close, 50 ): Value1 = Close ; The “is” keyword is an EasyLanguage skip keyword and can be use for better clarity as in the following: Case is < Average( High, 75 ): Value1 = High ; Example Switch(Value1) Begin Case 1 to 5: Value2 = Value2 + 1; Case 10, 20, 30: Value3 = Highest(High,10); Case is > 40: Value3 = Value3 + 1; Default: Value5 = Value5 + 1; End; The above switch statement Increments Value2 when the switch expression (Value1) is a value from 1 to 5; assigns Value3 to the highest high of 10 bars ago when the switch expression is either 10, 20 or 30; increments Value4 for all switch expression values above 40; and increments Value5 for any other values of the switch expression. Source: EasyLanguage manual
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.