Backtest script based on the previous RSI-VWAP indicator:

It's the popular RSI indicator with VWAP as a source instead of close:
- RSI_VWAP = rsi ( vwap (close), RSI_VWAP_length)

What is the Volume Weighted Average Price ( VWAP )?
VWAP is calculated by adding up the dollars traded for every transaction (price multiplied by the number of shares traded) and then dividing by the total shares traded.

Trades are laddered to improve the average entry price and each entry is increased, improving the entry but increasing the risk of being liquidated.

It can be easily converted to study (alerts)

Settings for BINANCE:BTCUSDT at 30m

發布通知: Another sub-level of overbought and oversold has been added for more possible entries.
A condition has been added so that each entry is better than the previous one according with the average price of the position.
The closing percentage for the Take Profit has been added.
Bulls and bears can be activated independently or all at once.

Happy Trading...




Hi, i'm getting an error line 88: The function 'fixnan' should be called on each calculation for consistency. It is recommended to extract the call from this ternary operator. could any one help me please
+1 回覆
Hi @XaviZ , Bro i just gone through it , it is awesome , i need one confimation , in back tet mode when i change my properties of initail investment it just increases or decreases the Net Profit , higher the amount lower net profit , lower the amount higher profit and vice vera , plz could help to explain ?
Hey Xavi,
Great work with this script! I created an alerts script alongside the strategy script, but the alerts that I are firing are not showing up/matching what is showing as trades in the Strategy Tester. Any thoughts on why? Thanks in advance.
Hi XaviZ - great indicator while it worked though now it returns an error saying the order entry needs to be between 10000000000.0000 and 0 (I may have used more or less zeros in the large number). it may be that a data element it relies on isn't getting set or fed in. I tried the settings, and all values were positive/non-zero - so I guess it may be a feed element. does trading view calculate vwap for you? maybe their calculation is offline or something.
hope this helps,
MickeyMMM MickeyMMM
me again - it turns out the script works for SPY, etc but not AMZN or Goog. I'm guessing it may not work with NASDAQ exchange listed stocks.
Thank you Xavi for the script. I've noticed that for some entry and exit points, there's false positives that appear in real time (refreshing the page eliminates the indicator) before the final entry/exit point (not eliminated by refreshing) established later. Do you have any insight in the cause of this? I was thinking it could have been updated trading volumes after the bar is completed.

I am working with 1hr bars with extended trading hour data.
InvestingIsAScience InvestingIsAScience
@XaviZ I wanted to clarify my observation. It isn't a problem with the script. Not at all. IT'S GREAT. I realized my description wasn't detailing what I was trying to explain.

The false positives I've observed are of the most recent "final" bars that are >not< eliminated by refreshing. I've >only< seen this in the most recent bars. None of the established (>1 day after) bars have ever changed.

These "false positive" bars I'm seeing are falling in the transition zones between the opening and closing of the US market's official hours.

I wanted to know if you had any insight into the market data that TV receives. Is it updated for accuracy after a day has been completed? If not, no biggy.

Thanks for your work!
XaviZ InvestingIsAScience
@InvestingIsAScience, Hi ... That happens always in a "strategy" script on TV or in Backtest mode. Transform it into "study" or alerts and you'll see that it doesn't happen anymore.
@XaviZ, I'm working with the study form of the script. I had alerts setup as well. No alert was triggered either. Anyways, I'll consider it a post-updated volume causing the appearance and take that into account with my trading, unless you have another idea. Again, thanks for the script.