OHLC_v1
Download scriptThis script is designed to provide traders with a quick, high-level snapshot of the price action for the current day and the previous trading day. Instead of cluttering your charts with complex lines or shapes, it serves as an informational dashboard that displays key statistical data directly on your screen in real-time.
Key Functionality
The logic follows a straightforward process to help you monitor market volatility and price levels:
- Historical Data Retrieval: The script automatically identifies the specific "Daily" candles for both today (the current live candle) and yesterday (the completed previous day).
- Core Price Points: For each of these two days, the script extracts four essential pieces of information:
- Open: The price at which the trading day began.
- High: The highest price reached during that period.
- Low: The lowest price reached during that period.
- Close: The current market price (for today) or the final price of the previous session.
- Volatility Measurement (Range): Beyond just listing prices, the script calculates the total "Range" for both days. It does this by subtracting the Low from the High and converting that value into a readable point count. This allows you to see at a glance how much the market moved in total for each session.
User Experience
When active, the script generates a clean text summary on your trading platform. It displays the "Yesterday" data first, followed by the "Today" data. By presenting these figures side-by-side, it enables you to quickly compare today's price movement against yesterday's performance, helping you gauge current market momentum and volatility without having to manually scroll through historical charts.
//+------------------------------------------------------------------+
//| OHLC |
//| Copyright © 2006, Robert Hill |
//| http://www.metaquotes.net/ |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Robert Hill "
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
int start()
{
Comment("Yesterdays ",
"O: " + DoubleToStr(iOpen(Symbol(), 1440, 1),Digits),
", H: " + DoubleToStr(iHigh(Symbol(), 1440, 1),Digits),
", L: " + DoubleToStr(iLow(Symbol(), 1440, 1),Digits),
", C: " + DoubleToStr(iClose(Symbol(), 1440, 1),Digits),
" Range = " + DoubleToStr( (iHigh(Symbol( ), 1440, 1) - iLow(Symbol( ), 1440, 1) ) / Point,0),"\n",
"Todays ",
"O: " + DoubleToStr(iOpen(Symbol(), 1440, 0),Digits),
", H: " + DoubleToStr(iHigh(Symbol(), 1440, 0),Digits),
", L: " + DoubleToStr(iLow(Symbol(), 1440, 0),Digits),
", C: " + DoubleToStr(iClose(Symbol(), 1440, 0),Digits),
" Range = " + DoubleToStr( (iHigh(Symbol( ), 1440, 0) - iLow(Symbol( ), 1440, 0) ) / Point,0),"\n");
return(0);
}
//+------------------------------------------------------------------+
Comments