Open price of red candle and EMA 34

Daniel

Active member
VIP
3xjNqUb.jpg
 
Last edited:

BenTen

Administrative
Staff
VIP
You should be able to set them up via the conditional wizard.

Here's an example:

Open is greater than or equal to EMA34

mdIX208.png


For request #4:

The open price of this particular red candle has to be equal to one of the previous opened price of red candle since the market opened on daily 1 min chart

You need to identify and define "this particular red candle" in a way that the TOS scanner can understand. I doubt it's possible unless you go into the specifics of it.
 

Daniel

Active member
VIP
Ben
How are you?

There is no way to create script for scaning of ....

Open price of red candle equal (can be also with small deviation) ) to one of the previous open red candle? (since the market opened)?


Thank you

Daniel
 
Last edited:

halcyonguy

Member
VIP
this looked like an interesting problem, so i wrote an upper study to draw arrows on the bars with a matching, previous open price.
I rarely write scans, so i'm not sure if this will work as a scan study, i didn't test it.
instead of looking for an exact match, i chose to check if the difference between 2 prices is less than a small number. ( i didn't want to miss a match, because one price has 4 decimal places and the other doesn't)
this is meant to be used during normal trading hours, not after hours.

there are bubbles that can be turned on, that show some variable values, barnumbers and bar counts.
can turn on labels that show similar data.

this is an upper chart study
during the current day,
when the current candle is moving down, (close < open)
look at previous candles,
search for and find the first match, a down candle with a similar open price.
a price match occurs when both opens are within a max difference. default is 0.005

an image with arrows
xumNTou.jpg


Code:
# findprevopen_01

# -------------------
# halcyonguy
# 05/24/2021
# -------------------
# upper chart study
#  during the current day,
#  when the current candle is moving down, (close < open)
#  look at previous candles,
#  search for and find the first match, a down candle with a similar open price.
#   a price match occurs when both opens are within a max difference, default is 0.005
#
# -------------------
# https://usethinkscript.com/threads/open-price-of-red-candle-and-ema-34.6603/
#  trying to create scanner criteria
#   rule 4. has to be
#    'The open price of this particular red candle has to be equal to one of the
#    previous opened price of red candle since the market opened on daily 1 min chart'
# -------------------

def redbar = open > close;
def na = double.nan;
def bn = barnumber();

def istoday = if GetLastDay() == GetDay() then 1 else 0;

#  390 min in a 6.5 hour trading day
def daymin = 390;
def chartagg = GetAggregationPeriod();
def chartmin = chartagg / (1000 * 60);
def chartbars = daymin/chartmin;

# get min from start time. calc qty bars so far today
def start = 0930;
def elapsedmin = (secondsfromTime(start) / 60);
def elapsedbars = elapsedmin / chartmin;

# -------------------

input show_arrow_when_triggered = yes;
input show_trigger_values = no;

input max_price_diff_for_match = 0.005;
input show_labels = no;

input test_show_barnumber_bubbles = no;
input test_bubbles1_daily_minutes_barnums = no;

# -----------------------------

def vertbubbleoffset = 0.001;

addlabel(show_labels, "open price difference max " + max_price_diff_for_match, color.yellow);
addlabel(show_labels, "chart min " + chartmin, color.yellow);
addlabel(show_labels, "bars / day " + chartbars, color.yellow);

# loop thru just the bars during the current day, looking for a price match
def x = fold  i = 1 to (elapsedbars + 1)
  with p = 1
  while (istoday and (absvalue(open - getvalue(open, i)) > max_price_diff_for_match) )
  do i;

# ====================================

# adjust the offset
def x2 = x + 1;

#  when loop finds a price match, check if prev bar and current bar are red
def redbars = ( (x > 1 and x < elapsedbars) and getvalue(redbar, x2) and redbar);

def vertlo = 1 - vertbubbleoffset;
addchartbubble(show_trigger_values and redbars, low * vertlo, "bn " + bn + "\nopen " + open + "\noffset " + x2 + "\nprev bn " + getvalue(bn, x2), color.yellow, no);

def verthi3 = 1 + (0.3 * vertbubbleoffset);
plot z = if  show_arrow_when_triggered and redbars then high * verthi3 else na;
z.SetPaintingStrategy(PaintingStrategy.arrow_down);
z.setlineweight(4);
z.setdefaultcolor(color.white);

# -------------------------

# test bubbles with barnumber. make 1st one of day white, rest gray
def vertlo2 = 1 - (0.3*vertbubbleoffset);
addchartbubble(test_show_barnumber_bubbles and elapsedmin == 0, low * vertlo2, bn, color.white, no);
addchartbubble(test_show_barnumber_bubbles and elapsedmin > 0, low * vertlo2, bn, color.gray, no);

# test bubbles
def verthi = 1 + (1 * vertbubbleoffset);
addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin == 0, (high * verthi), "minutes:" + elapsedmin + "\n" + "barnumber:" + elapsedbars, color.yellow, yes);
addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin > 0, high * verthi, elapsedmin + "\n" + elapsedbars, color.yellow, yes);
#


an image with yellow bubbles with values turned on
g7XEgYb.jpg


image with barnumber bubbles turned on
draw red lines to the prev bar that matches the open
KokNEHc.jpg
 
Last edited:

Daniel

Active member
VIP
this looked like an interesting problem, so i wrote an upper study to draw arrows on the bars with a matching, previous open price.
I rarely write scans, so i'm not sure if this will work as a scan study, i didn't test it.
instead of looking for an exact match, i chose to check if the difference between 2 prices is less than a small number. ( i didn't want to miss a match, because one price has 4 decimal places and the other doesn't)
this is meant to be used during normal trading hours, not after hours.

there are bubbles that can be turned on, that show some variable values, barnumbers and bar counts.
can turn on labels that show similar data.

this is an upper chart study
during the current day,
when the current candle is moving down, (close < open)
look at previous candles,
search for and find the first match, a down candle with a similar open price.
a price match occurs when both opens are within a max difference. default is 0.005

an image with arrows
xumNTou.jpg


Code:
# findprevopen_01

# -------------------
# halcyonguy
# 05/24/2021
# -------------------
# upper chart study
#  during the current day,
#  when the current candle is moving down, (close < open)
#  look at previous candles,
#  search for and find the first match, a down candle with a similar open price.
#   a price match occurs when both opens are within a max difference, default is 0.005
#
# -------------------
# https://usethinkscript.com/threads/open-price-of-red-candle-and-ema-34.6603/
#  trying to create scanner criteria
#   rule 4. has to be
#    'The open price of this particular red candle has to be equal to one of the
#    previous opened price of red candle since the market opened on daily 1 min chart'
# -------------------

def redbar = open > close;
def na = double.nan;
def bn = barnumber();

def istoday = if GetLastDay() == GetDay() then 1 else 0;

#  390 min in a 6.5 hour trading day
def daymin = 390;
def chartagg = GetAggregationPeriod();
def chartmin = chartagg / (1000 * 60);
def chartbars = daymin/chartmin;

# get min from start time. calc qty bars so far today
def start = 0930;
def elapsedmin = (secondsfromTime(start) / 60);
def elapsedbars = elapsedmin / chartmin;

# -------------------

input show_arrow_when_triggered = yes;
input show_trigger_values = no;

input max_price_diff_for_match = 0.005;
input show_labels = no;

input test_show_barnumber_bubbles = no;
input test_bubbles1_daily_minutes_barnums = no;

# -----------------------------

def vertbubbleoffset = 0.001;

addlabel(show_labels, "open price difference max " + max_price_diff_for_match, color.yellow);
addlabel(show_labels, "chart min " + chartmin, color.yellow);
addlabel(show_labels, "bars / day " + chartbars, color.yellow);

# loop thru just the bars during the current day, looking for a price match
def x = fold  i = 1 to (elapsedbars + 1)
  with p = 1
  while (istoday and (absvalue(open - getvalue(open, i)) > max_price_diff_for_match) )
  do i;

# ====================================

# adjust the offset
def x2 = x + 1;

#  when loop finds a price match, check if prev bar and current bar are red
def redbars = ( (x > 1 and x < elapsedbars) and getvalue(redbar, x2) and redbar);

def vertlo = 1 - vertbubbleoffset;
addchartbubble(show_trigger_values and redbars, low * vertlo, "bn " + bn + "\nopen " + open + "\noffset " + x2 + "\nprev bn " + getvalue(bn, x2), color.yellow, no);

def verthi3 = 1 + (0.3 * vertbubbleoffset);
plot z = if  show_arrow_when_triggered and redbars then high * verthi3 else na;
z.SetPaintingStrategy(PaintingStrategy.arrow_down);
z.setlineweight(4);
z.setdefaultcolor(color.white);

# -------------------------

# test bubbles with barnumber. make 1st one of day white, rest gray
def vertlo2 = 1 - (0.3*vertbubbleoffset);
addchartbubble(test_show_barnumber_bubbles and elapsedmin == 0, low * vertlo2, bn, color.white, no);
addchartbubble(test_show_barnumber_bubbles and elapsedmin > 0, low * vertlo2, bn, color.gray, no);

# test bubbles
def verthi = 1 + (1 * vertbubbleoffset);
addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin == 0, (high * verthi), "minutes:" + elapsedmin + "\n" + "barnumber:" + elapsedbars, color.yellow, yes);
addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin > 0, high * verthi, elapsedmin + "\n" + elapsedbars, color.yellow, yes);
#


an image with yellow bubbles with values turned on
g7XEgYb.jpg


image with barnumber bubbles turned on
draw red lines to the prev bar that matches the open
KokNEHc.jpg
Thank you so much for your detailed reply.
I will test it.
 

halcyonguy

Member
VIP
halcyonguy,
how are you?
i see few sections here, which one is the scanner?
Thank you!
hi daniel, please go reread my post again. it is an upper study, not a scan.
" , so i wrote an upper study to draw arrows on the bars with a matching, previous open price.
I rarely write scans, so i'm not sure if this will work as a scan study, i didn't test it."
..
it is all one study. sometimes i add a row of characters between different sub sections of a study, to separate the different sections.

i haven't done much experimenting with scanner scripts, so i don't know if fold loops work the same when used in scan studies.

i will make another version , for a lower study. then theoretically you can remove the declare lower line and use it as a scan, but no guarantees.
 

halcyonguy

Member
VIP
i didn't test this as a scan, which is why i am posting this as a lower study

here is a lower study. it plots a 1 when a match is found, a previous price matches the current price.

to try this as a scan study, remove the line
declare lower;

Python:
# findprevopen_01b_lower

# change upper to a lower
# to possibly be used in a scanner
#  disable labels
#  disable bubbles
#  convert plots to def.  have just 1 plot ,  1 or 0


# findprevopen_01

# -------------------
# halcyonguy
# 05/24/2021
# -------------------
# upper chart study
#  during the current day,
#  when the current candle is moving down, (close < open)
#  look at previous candles,
#  search for and find the first match, a down candle with a similar open price.
#   a price match occurs when both opens are within a max difference, default is 0.005
#
# -------------------
# https://usethinkscript.com/threads/open-price-of-red-candle-and-ema-34.6603/
#  trying to create scanner criteria
#   rule 4. has to be
#    'The open price of this particular red candle has to be equal to one of the
#    previous opened price of red candle since the market opened on daily 1 min chart'
# -------------------

declare lower;

def redbar = open > close;
def na = double.nan;
def bn = barnumber();

def istoday = if GetLastDay() == GetDay() then 1 else 0;

#  390 min in a 6.5 hour trading day
def daymin = 390;
def chartagg = GetAggregationPeriod();
def chartmin = chartagg / (1000 * 60);
def chartbars = daymin/chartmin;

# get min from start time. calc qty bars so far today
def start = 0930;
def elapsedmin = (secondsfromTime(start) / 60);
def elapsedbars = elapsedmin / chartmin;

# -------------------

input show_arrow_when_triggered = yes;
input show_trigger_values = no;

input max_price_diff_for_match = 0.005;
input show_labels = no;

input test_show_barnumber_bubbles = no;
input test_bubbles1_daily_minutes_barnums = no;

# -----------------------------

def vertbubbleoffset = 0.001;

#addlabel(show_labels, "open price difference max " + max_price_diff_for_match, color.yellow);
#addlabel(show_labels, "chart min " + chartmin, color.yellow);
#addlabel(show_labels, "bars / day " + chartbars, color.yellow);

# loop thru just the bars during the current day, looking for a price match
def x = fold  i = 1 to (elapsedbars + 1)
  with p = 1
  while (istoday and (absvalue(open - getvalue(open, i)) > max_price_diff_for_match) )
  do i;

# ====================================

# adjust the offset
def x2 = x + 1;

#  when loop finds a price match, check if prev bar and current bar are red
def redbars = ( (x > 1 and x < elapsedbars) and getvalue(redbar, x2) and redbar);

def vertlo = 1 - vertbubbleoffset;
#addchartbubble(show_trigger_values and redbars, low * vertlo, "bn " + bn + "\nopen " + open + "\noffset " + x2 + "\nprev bn " + getvalue(bn, x2), color.yellow, no);

def verthi3 = 1 + (0.3 * vertbubbleoffset);
#plot z = if  show_arrow_when_triggered and redbars then high * verthi3 else na;
#z.SetPaintingStrategy(PaintingStrategy.arrow_down);
#z.setlineweight(4);
#z.setdefaultcolor(color.white);

# if a previous price that matches the currect price, is found, plot a 1
plot z = if redbars then 1 else 0;

# -------------------------

# test bubbles with barnumber. make 1st one of day white, rest gray
def vertlo2 = 1 - (0.3*vertbubbleoffset);
#addchartbubble(test_show_barnumber_bubbles and elapsedmin == 0, low * vertlo2, bn, color.white, no);
#addchartbubble(test_show_barnumber_bubbles and elapsedmin > 0, low * vertlo2, bn, color.gray, no);

# test bubbles
def verthi = 1 + (1 * vertbubbleoffset);
#addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin == 0, (high * verthi), "minutes:" + elapsedmin + "\n" + "barnumber:" + elapsedbars, color.yellow, yes);
#addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin > 0, high * verthi, elapsedmin + "\n" + elapsedbars, color.yellow, yes);

#addchartbubble(yes, low, istoday, color.green,no);
#

in the picture, the top chart is the original study, drawing arrows when a match is found.
the lower part is this lower study, plotting 1 when a match is found

WlafqZi.jpg
 

Daniel

Active member
VIP
i didn't test this as a scan, which is why i am posting this as a lower study

here is a lower study. it plots a 1 when a match is found, a previous price matches the current price.

to try this as a scan study, remove the line
declare lower;

Python:
# findprevopen_01b_lower

# change upper to a lower
# to possibly be used in a scanner
#  disable labels
#  disable bubbles
#  convert plots to def.  have just 1 plot ,  1 or 0


# findprevopen_01

# -------------------
# halcyonguy
# 05/24/2021
# -------------------
# upper chart study
#  during the current day,
#  when the current candle is moving down, (close < open)
#  look at previous candles,
#  search for and find the first match, a down candle with a similar open price.
#   a price match occurs when both opens are within a max difference, default is 0.005
#
# -------------------
# https://usethinkscript.com/threads/open-price-of-red-candle-and-ema-34.6603/
#  trying to create scanner criteria
#   rule 4. has to be
#    'The open price of this particular red candle has to be equal to one of the
#    previous opened price of red candle since the market opened on daily 1 min chart'
# -------------------

declare lower;

def redbar = open > close;
def na = double.nan;
def bn = barnumber();

def istoday = if GetLastDay() == GetDay() then 1 else 0;

#  390 min in a 6.5 hour trading day
def daymin = 390;
def chartagg = GetAggregationPeriod();
def chartmin = chartagg / (1000 * 60);
def chartbars = daymin/chartmin;

# get min from start time. calc qty bars so far today
def start = 0930;
def elapsedmin = (secondsfromTime(start) / 60);
def elapsedbars = elapsedmin / chartmin;

# -------------------

input show_arrow_when_triggered = yes;
input show_trigger_values = no;

input max_price_diff_for_match = 0.005;
input show_labels = no;

input test_show_barnumber_bubbles = no;
input test_bubbles1_daily_minutes_barnums = no;

# -----------------------------

def vertbubbleoffset = 0.001;

#addlabel(show_labels, "open price difference max " + max_price_diff_for_match, color.yellow);
#addlabel(show_labels, "chart min " + chartmin, color.yellow);
#addlabel(show_labels, "bars / day " + chartbars, color.yellow);

# loop thru just the bars during the current day, looking for a price match
def x = fold  i = 1 to (elapsedbars + 1)
  with p = 1
  while (istoday and (absvalue(open - getvalue(open, i)) > max_price_diff_for_match) )
  do i;

# ====================================

# adjust the offset
def x2 = x + 1;

#  when loop finds a price match, check if prev bar and current bar are red
def redbars = ( (x > 1 and x < elapsedbars) and getvalue(redbar, x2) and redbar);

def vertlo = 1 - vertbubbleoffset;
#addchartbubble(show_trigger_values and redbars, low * vertlo, "bn " + bn + "\nopen " + open + "\noffset " + x2 + "\nprev bn " + getvalue(bn, x2), color.yellow, no);

def verthi3 = 1 + (0.3 * vertbubbleoffset);
#plot z = if  show_arrow_when_triggered and redbars then high * verthi3 else na;
#z.SetPaintingStrategy(PaintingStrategy.arrow_down);
#z.setlineweight(4);
#z.setdefaultcolor(color.white);

# if a previous price that matches the currect price, is found, plot a 1
plot z = if redbars then 1 else 0;

# -------------------------

# test bubbles with barnumber. make 1st one of day white, rest gray
def vertlo2 = 1 - (0.3*vertbubbleoffset);
#addchartbubble(test_show_barnumber_bubbles and elapsedmin == 0, low * vertlo2, bn, color.white, no);
#addchartbubble(test_show_barnumber_bubbles and elapsedmin > 0, low * vertlo2, bn, color.gray, no);

# test bubbles
def verthi = 1 + (1 * vertbubbleoffset);
#addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin == 0, (high * verthi), "minutes:" + elapsedmin + "\n" + "barnumber:" + elapsedbars, color.yellow, yes);
#addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin > 0, high * verthi, elapsedmin + "\n" + elapsedbars, color.yellow, yes);

#addchartbubble(yes, low, istoday, color.green,no);
#

in the picture, the top chart is the original study, drawing arrows when a match is found.
the lower part is this lower study, plotting 1 when a match is found

WlafqZi.jpg
I got it...thanks do much for your reply.
i didn't test this as a scan, which is why i am posting this as a lower study

here is a lower study. it plots a 1 when a match is found, a previous price matches the current price.

to try this as a scan study, remove the line
declare lower;

Python:
# findprevopen_01b_lower

# change upper to a lower
# to possibly be used in a scanner
#  disable labels
#  disable bubbles
#  convert plots to def.  have just 1 plot ,  1 or 0


# findprevopen_01

# -------------------
# halcyonguy
# 05/24/2021
# -------------------
# upper chart study
#  during the current day,
#  when the current candle is moving down, (close < open)
#  look at previous candles,
#  search for and find the first match, a down candle with a similar open price.
#   a price match occurs when both opens are within a max difference, default is 0.005
#
# -------------------
# https://usethinkscript.com/threads/open-price-of-red-candle-and-ema-34.6603/
#  trying to create scanner criteria
#   rule 4. has to be
#    'The open price of this particular red candle has to be equal to one of the
#    previous opened price of red candle since the market opened on daily 1 min chart'
# -------------------

declare lower;

def redbar = open > close;
def na = double.nan;
def bn = barnumber();

def istoday = if GetLastDay() == GetDay() then 1 else 0;

#  390 min in a 6.5 hour trading day
def daymin = 390;
def chartagg = GetAggregationPeriod();
def chartmin = chartagg / (1000 * 60);
def chartbars = daymin/chartmin;

# get min from start time. calc qty bars so far today
def start = 0930;
def elapsedmin = (secondsfromTime(start) / 60);
def elapsedbars = elapsedmin / chartmin;

# -------------------

input show_arrow_when_triggered = yes;
input show_trigger_values = no;

input max_price_diff_for_match = 0.005;
input show_labels = no;

input test_show_barnumber_bubbles = no;
input test_bubbles1_daily_minutes_barnums = no;

# -----------------------------

def vertbubbleoffset = 0.001;

#addlabel(show_labels, "open price difference max " + max_price_diff_for_match, color.yellow);
#addlabel(show_labels, "chart min " + chartmin, color.yellow);
#addlabel(show_labels, "bars / day " + chartbars, color.yellow);

# loop thru just the bars during the current day, looking for a price match
def x = fold  i = 1 to (elapsedbars + 1)
  with p = 1
  while (istoday and (absvalue(open - getvalue(open, i)) > max_price_diff_for_match) )
  do i;

# ====================================

# adjust the offset
def x2 = x + 1;

#  when loop finds a price match, check if prev bar and current bar are red
def redbars = ( (x > 1 and x < elapsedbars) and getvalue(redbar, x2) and redbar);

def vertlo = 1 - vertbubbleoffset;
#addchartbubble(show_trigger_values and redbars, low * vertlo, "bn " + bn + "\nopen " + open + "\noffset " + x2 + "\nprev bn " + getvalue(bn, x2), color.yellow, no);

def verthi3 = 1 + (0.3 * vertbubbleoffset);
#plot z = if  show_arrow_when_triggered and redbars then high * verthi3 else na;
#z.SetPaintingStrategy(PaintingStrategy.arrow_down);
#z.setlineweight(4);
#z.setdefaultcolor(color.white);

# if a previous price that matches the currect price, is found, plot a 1
plot z = if redbars then 1 else 0;

# -------------------------

# test bubbles with barnumber. make 1st one of day white, rest gray
def vertlo2 = 1 - (0.3*vertbubbleoffset);
#addchartbubble(test_show_barnumber_bubbles and elapsedmin == 0, low * vertlo2, bn, color.white, no);
#addchartbubble(test_show_barnumber_bubbles and elapsedmin > 0, low * vertlo2, bn, color.gray, no);

# test bubbles
def verthi = 1 + (1 * vertbubbleoffset);
#addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin == 0, (high * verthi), "minutes:" + elapsedmin + "\n" + "barnumber:" + elapsedbars, color.yellow, yes);
#addchartbubble(test_bubbles1_daily_minutes_barnums and elapsedmin > 0, high * verthi, elapsedmin + "\n" + elapsedbars, color.yellow, yes);

#addchartbubble(yes, low, istoday, color.green,no);
#

in the picture, the top chart is the original study, drawing arrows when a match is found.
the lower part is this lower study, plotting 1 when a match is found

WlafqZi.jpg
Thanks so much for your reply and attention 👍
 

rad14733

Well-known member
VIP
Hi again
i am kind of confused.
What part is the scan ? can you mark it ?
Thank you
Daniel

Have you tried anything...??? A quick perusal of this topic, and the image above, indicates that the lower indicator in Post #9 would work for scanning as it triggers true or false... Use that code, saved as a Study, and reference the single plot from within the scanner and see what you get... You can't break anything by experimenting and in doing so you could have already found your answer rather than waiting and then double-posting...
 

Daniel

Active member
VIP
Have you tried anything...??? A quick perusal of this topic, and the image above, indicates that the lower indicator in Post #9 would work for scanning as it triggers true or false... Use that code, saved as a Study, and reference the single plot from within the scanner and see what you get... You can't break anything by experimenting and in doing so you could have already found your answer rather than waiting and then double-posting...
Thanks so much for your reply
I will go over it again. 👍
 

Daniel

Active member
VIP
Have you tried anything...??? A quick perusal of this topic, and the image above, indicates that the lower indicator in Post #9 would work for scanning as it triggers true or false... Use that code, saved as a Study, and reference the single plot from within the scanner and see what you get... You can't break anything by experimenting and in doing so you could have already found your answer rather than waiting and then double-posting..
rad14733,

i did what you said , plot # 9 , i added it as a study and save as a study , i also removed the declare lower line
when i try to add it to the scanner , TOS does not let me to O.K it
i am doing something wrong here , you have to understand that i still new with code script .
Can you please go step by step with me because i am doing it wrong again & again.
Please help !
Thanks so much for your time.

Daniel
 

rad14733

Well-known member
VIP
@Daniel The scanner doesn't pay any attention to declare lower or upper so there is no need to remove or comment it out...

Are you receiving any errors that negate the Save/Ok button...??? I just Copied and Pasted the code from Post #9 into a Study named Test, referenced it as a Study in the Scanner, used the only Plot, named z, set the Condition to is true and Saved... So it works... Did you forget to set the Condition to is true...???
 

Daniel

Active member
VIP
@Daniel The scanner doesn't pay any attention to declare lower or upper so there is no need to remove or comment it out...

Are you receiving any errors that negate the Save/Ok button...??? I just Copied and Pasted the code from Post #9 into a Study named Test, referenced it as a Study in the Scanner, used the only Plot, named z, set the Condition to is true and Saved... So it works... Did you forget to set the Condition to is true...???
I am out of my home I will check it out later on
Thank you for you quick reply 👍
Daniel.
 

Daniel

Active member
VIP
I am out of my home I will check it out later on
Thank you for you quick reply 👍
Daniel.

Hi again

SET UP STUDY: ( i named it RED_CANDLE)

i copy the entire script , than create and pasted the script , i am receiving errors that negate the Ok button. ( my RED_CANDLE study name was in red color, its mean that something wrong)
i removed the word Python on the top of the script , the red color gone ,after that i could save it on my study ( everything looks alright to me)

SET UP SCAN :

i selected RED_CANDLE on my scan
I set it up on my scan as RED_CANDLE (plot z) IS true WITHIN 1 BARS , than i save it and click OK ( everything looks alright to me)
But... when i switch between Day to Minute or extended check box , i am receiving errors that negate the save button.
and the scan button can not be used
I do not know what to do .


Question for you ,

i am in Los angeles ,do i have to change the time in the script from 0930; to 06:30am? because the market open at 06:30am los angeles times?


# get min from start time. calc qty bars so far today
def start = 0930;
def elapsedmin = (secondsfromTime(start) / 60);
def elapsedbars = elapsedmin / chartmin;


Thank you so much for your help !

Daniel
 
Last edited:

Similar threads

Top