In this EasyLanguage & PowerLanguage Tutorial, we’ll talk about the EasyLanguage Bars. This tutorial can also be studied by PowerLanguage & MultiCharts users.
Every trading system needs to study the bars, and the developer needs to know how to extract the data from the chart.
In EasyLanguage and PowerLanguage, there are many reserved words that you can use to send data about the bars to your program.
With BarInterval, you can calculate the bar interval value for intraday charts.
Write an indicator like this:
It’s one line of code. If you put this indicator in a 60min chart, the output will be number 60.
With BarType reserved word, you can extract the value of the current chart’s interval type.
This is the output number that you could obtain:
- 0 – Volume Bar
- 1 – Intraday Bar
- 2 – Daily Bar
- 3 – Weekly Bar
- 4 – Monthly Bar
- 5 – Point and Figure
With CurrentBar, you can extract the number of the bar that is currently being calculated.
High – Low – Open – Close values
In every indicator and trading system, you need to know the Opening Price, Closing Price, Low Price, and High Price values.
You can use this data with the respective Reserved Words:
- High52Wk – Current 52 week High
- Low52Wk – Current 52 week Low
Suppose you want to print all Opening Bars Value, write:
Plot1(Open, “Opening Bars”);
Many times you need to know the total volume of a daily bar or intraday bar. You can extract five different Volume Data:
- Volume – Trade volume in contracts
- Ticks – Trade Volume in Ticks
- Upticks – Trade Volume in Ticks (only Up)
- Downticks – Trade Volume in Ticks (only Down)
- OpenInt – Number of outstanding contracts for a future or option
There are many other reserved words about the Volume data.
When the stock has options listed and tradable on a market exchange, we can extract a lot of interesting data:
- CallVolume – Total Volume of the call option
- PutVolume – Total Volume of the put option
- CallOpenInt – Total Open Interest of the Call Option
- IVolatility – Daily Implied Volatility based on the options