RSI oversold after 9 ema crosses below VWAP


Category:
0
0

Using some of your videos and some of the previously asked questions I was able to come up with the following code, which sort of works.

 

I am trying to get it to show when the RSI crosses back over 28, but only if it has been at least 30 bars since the 9ma dropped below the VWAP.

Any help would be greatly appreciated!

 

RSI().”RSI” crosses above 28 or MovAvgExponential().”AvgExp” from 30 bars ago crosses below reference VWAP().”VWAP” from 30 bars ago

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 7, 2021 8:46 pm
297 views
0
Private answer

I moved your post out of the "Strategy Guide" topic and into the "Stock Scanners" topic. There were no AddOrder() statements in the code and nothing in your question mentioned trying to use this to build a chart strategy.

I also updated the title of the question to include some very important details your original was lacking.

This cannot be completed using just the Condition Wizard. The reason for this is there is no method in the Condition Wizard to specify "at least 30 bars ago". So we must break things out into separate variable statements and then assemble the individual pieces to derive the final output you have specified.

I tried to retain as much of your original code as possible so you can follow along and note the changes.

input minimumBarsBack = 30;
def condition = MovAvgExponential().”AvgExp” crosses below reference VWAP().”VWAP”;
def trigger = RSI().”RSI” crosses above 28;
plot scan = Highest(condition, minimumBarsBack) < 1 and trigger;

Marked as spam
Posted by (Questions: 37, Answers: 4090)
Answered on March 8, 2021 8:26 am
0
Thank you for that, it was a little late last night when I sent through the question. It is a lot closer than I originally had. Is there a way to limit this to only alert when the 9ma is below the vwap? I have played with the code for a few hours now and can't seem to get anywhere.
( at March 8, 2021 8:51 pm)
0
I suggest you simply add that as a separate Study Filter on your scan rather than try to incorporate that into the code I provided for this request.
( at March 8, 2021 9:42 pm)