A paintbar study designed to ‘paint’ the minute bar on a 10 second bar chart. It uses two different approaches:
1) Since the Time or T statement represents time in an HHMM format it does not store seconds. This means that we can detect the minute bar when T <> T[1], i.e. time this bar is different from time last bar (ignoring seconds)
2) The second approach used the DateTime class to give the second in the time. When the seconds are zero it means that the current bar is a minute bar.
Copy the quick-tip 76 TradeStation EasyLanguage PaintBar study code
You can copy the tutorial code below.
{ THIS PAINTBAR STUDY IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION IS AT YOUR OWN RISK. THIS PAINTBAR STUDY AND ASSOCIATED TECHNIQUES IS AN EXAMPLE ONLY, AND HAS BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF THIS PAINTBAR STUDY DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.} { A paintbar study designed to 'paint' the minute bar on a 10 second bar chart. It uses two different approaches: 1) Since the Time or T statement represents time in an HHMM format it does not store seconds. This means that we can detect the minute bar when T <> T[1], i.e. time this bar is different from time last bar (ignoring seconds) 2) The second approach used the DateTime class to give the second in the time. When the seconds are zero it means that the current bar is a minute bar.} // Ver. 1.0 Nov 17, 2022 Original version // Namespace for the DateTime class //Using elsystem; Input: int Color( Magenta ); // The color to paint the minute bars on a 10 second chart // Time or T return a numeric expression representing the EasyLanguage time (HHMM format) If T <> T[1] then PlotPB( H, L, "Minute", Color ); // I.e. if the time is different from the last bar (ignoring seconds) // References the DateTime object properties for the specific bar (see the DateTime class) If BarDateTime.Second = 0 then PlotPB( H, L, "Minute", Color ); // i.e. when the second value is zero { ** Copyright (c) 2022 Markplex Corporation. All rights reserved. ** ** Markplex Corporation reserves the right to modify or overwrite this analysis technique on its https://markplex.com Web site. ** }