Skip to content

QuickTip 76 | Painting the minute bar on a 10 second bar chart

qt76

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.

Compatibility

This Quick-tip was developed in TradeStation version 10.0. It also works in MultiCharts but only when using the T <> T[1] approach.
Quick-tip 76 applied to 10 seconds GBPUSD chart
Quick-tip 76 applied to 10 seconds GBPUSD chart

Video explanation of quick-tip 76

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. ** }

THE TRADING APPS, INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT 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/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK. ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, TRADING APPS, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.