Logistic RSI, STOCH, ROC, AO, ... by DGT

Experimental attemt of applying Logistic Map Equation for some of widly used indicators.
With this study "Awesome Oscillator (AO)", "Rate of Change ( ROC )", "Relative Strength Index ( RSI )", "Stochastic ( STOCH )" and a custom interpretation of Logistic Map Equation is presented

Calculations with Logistic Map Equation makes sense when the calculated results are iterated many times within the same equation.

Here is the Logistic Map Equation : Xn+1 = r * Xn * (1 - Xn)

Where, the value of r is the key for this equation which changes amazingly the behaviour of the Logistic Map.

The value we have asigned for r is less then 1 and greater than 0 ( 0 < r < 1) and in this case the iterations performed with the maximum number of output series allowed by Pine is quite enough for our purpose and thanks to arrays we can easiliy store them for further processing

What we have as output:
Each iteration result is then plotted (excluding plotting the first iteration), as circles or line based on user preference

Values above and below zero level (0) are coloured differently to emphasis bull and bear power

Finally Standard Deviation of Array's Elements is ploted as line. Users may choose to display this line only

So where it comes the indicators "Awesome Oscillator (AO)", "Rate of Change ( ROC )", "Relative Strength Index ( RSI )", "Stochastic ( STOCH )".
Those are the indicators whose values are assigned to our key varaiable in the Logistic Map equation forulma which is r

Further details regarding Logistic Map can found under the description of “Logistic EMA w/ Signals by DGT” study

Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
릴리즈 노트: backtest ability added that will help to
- compare different techniques available within the study
- observe performance statistics of an financial instruments on different time frames
- observe performance statistics of different types of financial instruments (stocks, forex, crypto, etc)

optimization ability kept minimal to keep the study simpler

ps: multi time frame ability disabled
릴리즈 노트: it is better to have optimization ability ;-)

ability to change the length and source of the selected indicator and observe the performance effects.

ps : not applied to Awesome Oscillator (AO)
릴리즈 노트: little tweaking for labels, few more stats

also, added labels for entries and exits with some basic stats
릴리즈 노트: exit price calculation error fixed when stop loss condition meets

many many thanks for your highly valuable comments @sotiri 🙏
릴리즈 노트: enchanced non-repainting backtest ability

thanks for the warning @canpp
릴리즈 노트: typo correction

entry/exit price assumption default value changed to close
릴리즈 노트: Updates with this release

Enhancements in BackTest Framework

• Historical Data Evaluation
in the real-time processing when the condition is satisfied to avoid repainting the signals are presented on the next bar, this feature was already available with this study
change implemented with this update is to made historical data evaluation behavior same as real-time behaviour and all plottings, statistical panel calculations are performed based on the next bar

- traders will observe the same behavior both in real-time and in historical bars (even when the study is reloaded)
- trade statistics will display what ever the user traded on the real-time bars with the signals generated
- since the signals are generated on the next bar, “Entry/Exit Price Assumption” input necessity is no longer required, trades with the backtest framework will be assumed as open price on the next candle

• Early Warning : Alert + Label
As a rule as explaind above, signals are triggered on the next bar in case the condition is still valid and the logic of the study is already aware of the likelihood of an signal occurrence on the next bar but the trader who is analyzing the chart is not (according to this study’s logic of course). So to increase the awerness, with this update ;
- a label with a warning sign is going to be plotted which of course is subject to repaint but will warn the trader to keep eyes closer on the instrument and proceed trading immediatly on the next bar if the signal is confirmed and presented on the chart.
- for the same warning also an alert is defined (using new alert() function call), so the trader will be able to be notified with the probable not yet confirmed trade opoortunity in advance, even if the trader is not monitoring the instrument.
Having said that, I would like to remind : Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely.

Example of warning label

• Improved Conditions

Since the long/short conditions are triggered on next bar there might be cases where a sudden change in price direction may occur especially in sideway market conditions with low volatility, so to avoid such cases the conditions are improved.

Please note : stop loss condition will be executed when price fall below the caculated value and trade will be closed with the close price on bar close (not yet able to get the price value at the moment of the cross). Stop loss condition is subject to repainting and to avoid any further loss an alert can be triggered at the moment the first corss is observed. Since stop loss is subject to repaint and in case it happens the statistical panel calculation will not be able to calculate till the bar is closed. You may disable application of stop loss from user dialog box to avoid any inconsistancy that may apear on statistical panel and observe results of the trades executed without stop loss.

Other updates in Study

  • - Added stepline plotting option, beside line and dotted plotting
    - Added option to hide trading statistical panel
    - Increased Label plotting count
    - Finally, Organized Script Inputs in Sections
릴리즈 노트: have received so many request to add alerts for all conditions separately and this update includes them (both for Logistic Part and Backtest Framework)

made "Candle Direction as Confirmation" and "Avoid Sudden Price Changes" long/shot conditions optional
Important note : If these options are selected Backtest Framework Signals may repaint, use with caution and for test purpose

also, some cosmetic changes
릴리즈 노트: typo correction of alert messages
릴리즈 노트: A quick update, added an option with message to avoid any misuse

Please be informed that if any of the "Candle Direction as Confirmation" and "Avoid Sudden Price Changes" options selected Backtest Framework will execute trade simulation on the second bar after the STUDY detects a signal, otherwise on the next bar.

"❗❗❗ Simulate Trade on Next Bar : Only For Test Purpose (REPAINTS)", group = "Backtest Framework") option is for test purpose and when this option is selected the Backtest Framework will simulate trades on the next bar regardless of the above options
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.


이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?