DownBar Returns 1 if the bar is a DownBar, 0 if not. You define what 0

Posted on 17, June 2013

in Category SID

Description for DownBar SID 846

DownBar Returns 1 if the bar is a DownBar, 0 if not. You define what a DownBar is by specifying one or more columns as arguments. If you want to look for lower closes, then specify DownBar(Close). If you require a DownBar to be both lower highs and lo The logic for this technical analysis indicator:

#DownBar
#
# Returns 1 if the bar is a DownBar, 0 if not.
#
# Accepts up to four columns as arguments.  Only one column is compulsory.  For the bar to be considered a DownBar,
# all of the passed arguments must have a value lower than the value on the previous bar.
# The use of optional paramters allows this indicator to flag lower highs, or lower highs and lower lows, for example.
# Passing one column (e.g. Low) just looks for lower lows.  Passing (High,Low) returns 1 if both the high and low are lower.

my (\$Column1, \$Column2, \$Column3, \$Column4) = @_;

my \$NumColumns = 1;
ValidateColumns(\$Column1);

my \$DownCount = 0;

\$DownCount = If (\$Column1 < Ref(\$Column1,-1),\$DownCount = \$DownCount + 1,0);

if (\$Column2 > 0)
{
ValidateColumns(\$Column2);
\$NumColumns = \$NumColumns + 1;
\$DownCount = If (\$Column2 < Ref(\$Column2,-1),\$DownCount = \$DownCount + 1,0);
}
if (\$Column3 > 0)
{
ValidateColumns(\$Column3);
\$DownCount = If (\$Column3 < Ref(\$Column3,-1),\$DownCount = \$DownCount + 1,0);
\$NumColumns = \$NumColumns + 1;
}
if (\$Column4 > 0)
{
ValidateColumns(\$Column4);
\$DownCount = If (\$Column4 < Ref(\$Column4,-1),\$DownCount = \$DownCount + 1,0);
\$NumColumns = \$NumColumns + 1;
}

my \$DownBar = If(\$DownCount == \$NumColumns,1,0);
{"ft_lang_label":"__label__en","ft_lang_prob":0.558227,"math_prob":0.9856709,"size":1674,"snap":"2022-05-2022-21","text_gpt3_token_len":499,"char_repetition_ratio":0.22035928,"word_repetition_ratio":0.15053764,"special_character_ratio":0.31600955,"punctuation_ratio":0.17133956,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9767844,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-19T06:52:48Z\",\"WARC-Record-ID\":\"<urn:uuid:b7163b3c-8e43-4f9d-a7a5-8b61e62b6059>\",\"Content-Length\":\"34033\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0fd86548-8e32-42fa-8e97-6e3aff49e0b9>\",\"WARC-Concurrent-To\":\"<urn:uuid:d43b86bb-30e9-485d-ac7b-427af0feec3a>\",\"WARC-IP-Address\":\"54.208.33.52\",\"WARC-Target-URI\":\"http://www.seertrading.com/downbar-returns-1-if-the-bar-is-a-downbar-0-if-not-you-define-what/\",\"WARC-Payload-Digest\":\"sha1:EC2A3TTQ7UGXU77XAZXE6FPQVJJ4DG2V\",\"WARC-Block-Digest\":\"sha1:S2RBW7PR5373ZG7TDAV6C662FJ6QJSBF\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320301264.36_warc_CC-MAIN-20220119064554-20220119094554-00219.warc.gz\"}"}