Volume Supertrend AI

Volume Supertrend AI

Overview of the Volume SuperTrend AI Indicator

The Volume SuperTrend AI Indicator is a cutting-edge technical tool designed for forecasting price movement trends by integrating traditional SuperTrend calculations with artificial intelligence techniques, notably the k-nearest neighbors (KNN) algorithm. Its purpose is to arm traders with a more accurate means of discerning market trends, combining volume-weighted moving averages (VWMA) and the KNN algorithm to deliver both bullish and bearish signals.

How It Works

– Volume Analysis:

Leveraging volume-weighted moving averages (VWMA), the Volume SuperTrend AI underscores the significance of trading volume in determining trend direction. This enables a more precise reaction to market dynamics.

– Artificial Intelligence Integration – k-Nearest Neighbors (k-NN) Algorithm:

The k-NN algorithm is utilized to intelligently assess historical data points by comparing current parameters with past data. The nearest neighbors are used to generate predictive modeling, thus adapting to complex market patterns.

Usage Guide

– Trend Identification:

The indicator evaluates not just price movements but also trading volume, adding an additional layer to trend analysis. A green line below the price usually indicates an uptrend, reflecting bullish market sentiment, whereas a red line above the price denotes a downtrend, indicative of bearish conditions.

– Trend Continuation Signals:

The AI algorithm plays a critical role in determining the coloration of the Volume SuperTrend, facilitating trend prediction while retaining the fundamental attributes of the traditional SuperTrend.

– Dynamic Trailing Stop:

The Volume SuperTrend AI indicator acts as a dynamic trailing stop loss, adjusting to both price movement and trading volume. This method safeguards profits while allowing the trade to develop, incorporating volume for a more nuanced response to market shifts.

Settings

– AI Settings:

These include adjustments for the number of nearest neighbors to consider in the k-Nearest Neighbors (k-NN) algorithm and the amount of data points to analyze. These settings influence the model’s sensitivity to market fluctuations.

– AI Trend Settings:

This allows for the customization of the lengths of the weighted moving averages used for calculating both the price trend and the prediction trend. It includes options to enable or disable AI-generated trend signals.

– SuperTrend Settings:

These settings adjust the length of the SuperTrend and the factor, which is the multiplier for the Average True Range (ATR) in the SuperTrend calculation, as well as selecting the type of moving average for the SuperTrend calculation. This customization aligns with individual trading strategies and market conditions.

This comprehensive approach to market trend prediction merges traditional technical analysis with artificial intelligence innovations, offering traders a robust tool for decision-making in their trading activities.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Gaspare • 03/04/2024 #

    Grazie Ivan
    una domanda:
    quale TF ci puoi suggerire per operare sugli indici americani CFD?

  2. Iván • 03/04/2024 #

    I personally like it in daily timeframe

  3. oliTR • 03/04/2024 #

    Many thanks Ivan,
    I copy/paste your code to try it but could only get a constant stable uniform value for the SuperTrend.
    Is anything missing in the code?
    I think the problem is coming from “vwma = average[len,maSrc](close*volume)/average[len,maSrc](volume)”
    What did you intend to write here?
    Also, what is the use of “myindex = $indices[i]”?

    • Iván • 03/04/2024 #

      Hi,
      I’ve copied the code above and it works… what asset are you trying?
      $indices array use is to be complemented with $distance array. Currently not used in the code, but if you want to know an especific $distance it could be useful.
      If you want you can delete it.

  4. Hasardeur • 79 days ago #

    Hallo Ivan,
    are you shure that line 107 “myindex = $indices[i]” myindex is correct?

  5. oliTR • 49 days ago #

    Dear Iván,
    I am trying to set this indicator in a trading system.
    However, I have some issue at the end of the first part, when your indicator evaluates ‘mysupertrend’ before collecting data points.
    If used as an indicator then it returns a proper ‘mysupertrend’ signal, but when used in a code then it does not give any value. What could be the reason for that?

    // ~~ Calculate the SuperTrend based on the user’s choice
    vwma = average[len,maSrc](close*volume)/average[len,maSrc](volume)
    atr = averagetruerange[len](close)

    upperband = vwma + factor*atr
    lowerband = vwma – factor*atr

    if barindex < len then
    upperband = close
    lowerband = close
    direction = 1
    else
    //Redefine upperband
    if upperband < upperband[1] or close[1] > upperband[1] then
    upperband = upperband
    else
    upperband = upperband[1]
    endif
    //Redefine lowerband
    if lowerband > lowerband[1] or close[1] < lowerband[1] then
    lowerdband = lowerband
    else
    lowerband = lowerband[1]
    endif
    //Define Supertrend
    prevSupertrend = mysuperTrend[1]
    if prevSupertrend = upperband[1] then
    if close > upperband then
    direction = -1
    else
    direction = 1
    endif
    else
    if close < lowerband then
    direction = 1
    else
    direction = -1
    endif
    endif
    endif

    if direction = -1 then
    mysupertrend = lowerband
    else
    mysupertrend = upperband
    endif

    • Iván • 49 days ago #

      Hi. It works… just delete drawing lines and place buy and sell conditions.
      For example, if you want to enter long/short when the arrow appears:
      if Trendup then
      //drawtext(“▲”,barindex,currentsuperTrend)coloured(r,g,b)
      buy 1 contract at market
      elsif Trenddn then
      //drawtext(“▼”,barindex,currentsuperTrend)coloured(r,g,b)
      sellshort 1 contract at market
      endif
      graphonprice currentsuperTrend as “SuperTrend” coloured(r,g,b)

  6. oliTR • 49 days ago #

    Yes, I am sure it should work perfectly, but I found very strange vehavior like this one:

    If I set these lines right after the code:

    if g=250 then
    test=1
    elsif r=250 then
    test=-1
    else
    test=0
    endif
    graph test

    and then there is non matching between the colors of the indicator and what the code gives.

    Would you see something similar?

    (sorry but I can’t find how to attach a picture)

  7. oliTR • 48 days ago #

    well,
    it seems that the issue came from my backTest period which was not long enough.
    sorry

  8. oliTR • 38 days ago #

    Dear Ivan,
    why, in line 86, there is “currentsuperTrend[i]” and not “currentsuperTrend” only?

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas That's right, in ProScreener we can't have a lookback more than 254 days. There is nothing w...
cjdevasia Hi, Nicolas,     please guide me how can i scan following conditions in pro real time  S...
Nicolas For everyone benefit, I prefer to answer coding request in the forum. Please open a new topi...
Nicolas Thanks for contributing to the "ichimoku section" of the prorealtime code library Don't he...
sourberry Thank you , this is a great indicator works beautifully. Could you kindly modify to scr...
pp_playaflamenca Excuse me,... reading your code about spanB: [ SenkouSpanBFutureW = (Highest[SenkouSpanPerio...
Nicolas
8 years ago
Better Volume
Better Volume
39
Indicators
Keyeming Hello Nicolas; not sure to undersntad line 167, and in the video I d'ont remember that the a...
Nicolas I don't know, this code is 6 years old and I made a 1:1 translation of the provided code by ...
Alai-n https://emini-watch.com/free-stuff/volume-indicator/
danhei Hi I am tryong to figure out how trist strategy works. I am new to pro real time. Can some...
Plop61 Hello,Thank you for sharing this beautiful strategy.Is it possible to indicate the code for ...
NoName Thank you very much for this fascinating trading system. It is still proving to be extremely...
DANY I did it on demo account; it's too dangerous for mea and I can not resist psychologically  ....
demoz How can a demo account be dangerous? Did you have it run live (on a demo account for exampl...
DANY Yes, I mean that I tried on a demo account for 2 months and it had work fine, like the BackT...
Nicolas
9 years ago
Nicolas You will find the VWAP code from PRT here: https://www.prorealcode.com/topic/is-there-any-wo...
keks Thanks for sharing this wonderful code. Is there a way to draw a horizontal line to plot pre...
taklause Hello, just one question, can it be that this indicator does not work on ProRealTime v12? T...
MikeGC I don't know if you have used the variables a and b to optimise the parameters for the Super...
gianpiero75 I have not optimized, I multiplied the parameters for 6 (5,8), to use them on the 4  hoursTF...
bertrandpinoy bonjour Mike j utilise TrendChaser V2.0 et quand il prend position cela ne programme pas le ...
eisi If i switch between different Markets, the Backgroundcolour will appear where it should not...
datageek How can I get alerts on colour change?
NAMBO40 Hello, I would like to add a 25 period SMA moving average. It's possible?
avatar
Anonymous We try to enter before that the market actually turn. We try to anticipate it. In which way ...
dwgfx David-1984 are you saying that you've already factored in the spread within the code?  If y...
avatar
Anonymous no, not in teh code... only in the backtest. The entry is only between 8/22 so the spread fo...
Doctrading
9 years ago
gianlox What markets did you feel ? Thanks..
wanjpt Doctrading, could you code an alert when the supertrend touches price for various timeframes...
JSTAR PRODUCTIONS Hi there DocTrading, I have run this Screener and it only seems to screem When trend line to...
Henry
9 years ago
SuperTrend
SuperTrend
4
Indicators
Nicolas Exit and relaunch PRT should fix this behavior.
verdi55 Thank you. After a restart, it is somewhat faster; however, it still takes about 3 minutes t...
Nicolas Good! thanks for sharing your own code! Please do so with other ones if you think you can im...
Nicolas
9 years ago
Up on Big Volume
Up on Big Volume
0
Screeners
Nicolas
9 years ago
Nicolas
9 years ago
Nicolas
9 years ago
Nicolas Just replace the last line with this : RETURN dm as "Volume Weighted MACD", masignal as "Si...
thomas2004ch I happen to read this article. I would say the formel 'd = maslow - mafast' could be inverse...
Nicolas You are right! but still the picture is looking good. The formula is inverted! dunno why :) ...

Top