New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

Wide range bar off 20 SMA

Hi I am having difficulty setting this up:

[type is stock]
and [country is Canada]
and [today's range > yesterday's max(7,range)]
and [today's range x SMA(20,close)]//this is the one I am having trouble with for the set up.
and [ close > low + [range *.8]]
and [ open < low + [range *.1]]
and [volume>75000]

I can run this without line 4 and get many hits.
What I would like to do is find a positive WRB (close higher than Open) that is around the 20ma like the picture below.
The open can be below or a bit above the 20 ma.


Any help would be appreciated




Comments

  • markdmarkd mod
    edited January 25
    and [today's range x SMA(20,close)]//this is the one I am having trouble with for the set up

    "range" returns a number - the difference between the high and low, e.g. 5.99 high - 5.38 low returns (internally, to the scan engine) the number 0.61 (NOT the actual high and low).

    So, if the sma(20,close) is, 5.51, your statement is saying 0.61 (range) crosses above 5.51 (sma). But it doesn't, because yesterday's sma was something like 5.49 or 5.50, which is also above 0.61, so there was no crossover.

    I think what you want to ask for (from your chart example) is, the sma(20,close) is inside the range of the long body candle. The test for that could be:

    and [high > sma(20,close)]
    and [low < sma(20,close)]

    Or, if you want to be more inclusive:

    and [high >= sma(20,close)]
    and [low <= sma(20,close)]

    Or, if you want to be less inclusive, use open and close to put the sma inside the body of the candle instead of the whole range:

    and [close > sma(20,close)]
    and [open < sma(20,close)]

    P.S. it would be a little more efficient for the scan engine if you put the volume condition under country is Canada (i.e. third condition instead of last). That eliminates wasting time looking at lower volume stocks for your other conditions.

  • Thanks I will try those. Also thanks for the volume tip, I understand the logic now. Filter out the volume then run the conditions.

    I ran it doing the high and low and it isn't quite what I want. I revised a bit by making the low > instead of < which eliminated some of the WRB way under the 20ma.

    I would prefer it if the low is around + or - 15% of the 20 sma.

    If I wanted to add a percentage within 15% of the sma would it be like this? or would I use .85:

    and [high >= sma(20,close)]
    and [low >= sma(20,close)]
    and [low>.15*sma(20,close)]
    and [low<.15*sma(20,close)]

    I tried both ways, but it doesn't seem to work as I am getting 0 results. Can I put "or" in instead of and?
  • markdmarkd mod
    edited January 26
    Not sure what WRB is.

    So I gather you want the LOW to be near the sma - within 15 %.

    So, low less than 15% more than (above) the sma is

    and [low < sma(20,close) * 1.15]

    Low greater than 15% less than (below) the sma is

    and [low > sma(20,close) * .85]
  • Thanks I will check this out. WRB is wide range bar.
Sign In or Register to comment.