luyikaibr

MyMA Prism

luyikaibr 已更新   
This script implements the Binary Logic Trading (BLT) algorithm to calculate a score from 0 to 7. This score is calculated assigning a power of 2 weight to the positive sign of 3 Phi^3 distant Moving Average (MA) slopes. The largest MA slope positive sign receives weight 4, the middle length MA slope positive sign receives weight 2 and the shortest MA slope positive sign receives weight 1. The positive sign of an MA is defined as 1 if the slope of the MA is positive and 0, otherwise. Therefore, for MAs 305, 72 and 17, if slope(MA305) > 0, slope(MA72) < 0 and slope(MA17) > 0, then score will be 4*1 + 2*0 + 1*1 = 5. Up to my knowledge, this score was first proposed by Bo Williams and named by him as Prisma.

The used Moving Averages can be chosen between EMA and MyMA. MyMA is a Moving Average that tries to mimic Bo William's MIMA. Due to the close resemblance between MyMA and MIMA, I do not feel comfortable to open this script source code. In order to learn how this script operates with EMAs, please refer to my Custom EMA Prism indicator that has its source code open.

Due too sampling issues, this script ONLY WORKS with graphic time of 1d. I would like to thanks to MrBitmanBob for showing me how to get quotations from a graphic time distinct from the current one.

This script also gets sampling data from graphic times 2h and 30m to calculate their score. As, even for smaller graphic times, price data is sampled at the current time frequency, the MA lengths for those smaller graphic times needed to be proportionally decreased, meaning that when calculating the score for 1d with lengths 305, 72 and 17, the score for 2h must be calculated with lengths 72, 17 and 4, and the score for 30m must be calculated with lengths 17, 4 an 1. I understand that some precision may be lost but it is the best that is possible.

There is an optional setting for Crypto Currencies that instead of calculating the score for 1d, 2h and 30m, it calculates the score for 1d, 4h and 60m. This is due to the fact that Crypto Currencies are traded 24x7. Despite of this setting, the labels at the Style tab of the settings window remains 2h and 30m, because they must be constants.

This script with the corresponding MyMAs chart and the MyMAs Angle chart provides a broader view of the trading scenario.
發布通知:
This update normalizes the price before calculating the angle in order to minimize rounding loss of precision. It also adds an option to use current data src instead of using security() to retrieve smaller times. This option is due to my lack of confidence that this security() function returns useful data.
發布通知:
This update is just to change sample chart.
發布通知:
Due to the lack o accuracy on smaller graphic times, this update simplifies the indicator to show just the prism score for the current graphic time.
發布通知:
This update is just to make it clear that this indicator now works fine with every graphic time, not only 1d as before. For sharper candle movements delta should be set to 2, otherwise 4 works fine.
發布通知:
This update brings back other graphic times score calculation with some options offered. I finally managed to understand how to properly operate on distinct graphic times with security() function. I believe it works on any graphic time but I recommend it to be used with 1d.
發布通知:
This update just changes the order the scores are plot in order to make their value order match the order displayed by the chosen graphic times.
發布通知:
This update is just to fix the EMA calculation in the absence of enough candles. Instead of using TV standard zero price, I use the source (close) price.
發布通知:
This update adds the concept of Prism of Prism, calculating a new line that shows the score of the 3 scores. It also adds 2 new sets of graphic time options and it changes the default length of the top MA to 610.
發布通知:
This update fixes the Prism of Prism calculation and the Buy and Sell indication conditions.
發布通知:
This update adds a new and more meaningful angle calculation method and adjusts the MA calculation method.
發布通知:
This update just optimizes some implementation aspects. It also adds some graphic time options.
受保護腳本
該腳本是閉源發佈的,您可以自由使用。您可以把它加入到常用以在圖表上使用它。您無法查看或修改其原始碼。
免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?