Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different result from tradingview in VolatilityStop index

See original GitHub issue

the problem

hi, I noticed that in some cases there are discrepancies in the results from those calculated by the index and those presented by tradinview

to reproduce

Test code

var clinetBinace = new ApiClient_Binance();
            DateTime dateEnd = new DateTime(2020, 06, 01);
            var ohlcDays = clinetBinace.getOHLC(XtraCrypto_SymbolPair.BTC_USDT, TimeSpan.FromDays(1), endTime: dateEnd, limit: 300).ToQuote();
            var trendFast = ohlcDays.GetVolatilityStop(20, 2).ToList();
            DateTime[] dateTimesTest = new DateTime[]
                new DateTime(2020, 02, 17),
                new DateTime(2020, 02, 18),
                new DateTime(2020, 02, 19),
                new DateTime(2020, 02, 20),
                new DateTime(2020, 02, 24),
                new DateTime(2020, 02, 25),
                new DateTime(2020, 02, 26),
                new DateTime(2020, 02, 28),

                new DateTime(2020, 03, 1),
                new DateTime(2020, 03, 17),
                new DateTime(2020, 03, 18),
                new DateTime(2020, 03, 19),
                new DateTime(2020, 03, 20),

                new DateTime(2020, 04, 1),

                new DateTime(2020, 05, 8),
                new DateTime(2020, 05, 9),
                new DateTime(2020, 05, 10),
                new DateTime(2020, 05, 11),
                new DateTime(2020, 05, 12),
                new DateTime(2020, 05, 13),
                new DateTime(2020, 05, 14),
                new DateTime(2020, 05, 15),

            var trendVolatility = trendFast.Where(x => dateTimesTest.Contains(x.Date)).ToList();
            trendVolatility.ForEach(x => Console.WriteLine($"BINANCE - DATETIME: {x.Date}, UPPER: {x.UpperBand}, LOWER: {x.LowerBand}"));            

with this result image

and this tradingview result. You can see that upper start from 19/02 but VolatilityStop start from 26/02


Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

DaveSkendercommented, Jun 12, 2022

We use the original “Volatility System” stop and reverse formula from Welles Wilder’s book New Concepts in Technical Trading Systems.

DaveSkendercommented, Jun 22, 2022

@heavymanto, I’ll reopen this if you come back with a different conclusion after analyzing the above information and can arrive at a different conclusion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Volatility Stop - TradingView
Summary. The Volatility Stop indicator helps place effective stop-losses to develop an equilibrium between profiting off trades and controlling market risk.
Read more >
Volatility Stop — Technical Indicators - TradingView
This script shows three different calculations for volatility. All three can be used as Stop-Loss... - Absolute Price Changes - Maximum Price Fluctuation...
Read more >
Volatility Stop — Indicator by TradingView
Volatility Stop · 1. Immediately, when the condition is detected. This will produce repainting alerts. · 2. On the bar's close, to avoid ......
Read more >
Volatility — Technical Indicators - TradingView
Volatility-based indicators are valuable technical analysis tools that look at changes in market prices over a specified period of time.
Read more >
Vstop — Indicators and Signals — TradingView — India
This script allows Volatility Stop, an average true range-based indicator, to be plotted like a "Guppy" multiple moving average indicator.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found