# Custom EMA Prism

826浏览
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 EMAs' slopes. The largest EMA slope positive sign receives weight 4, the middle length EMA slope positive sign receives weight 2 and the shortest EMA slope positive sign receives weight 1. The positive sign of an EMA is defined as 1 if the slope of the EMA is positive and 0, otherwise. Therefore, for EMAs 305, 72 and 17, if slope(EMA305) > 0, slope(EMA72) < 0 and slope(EMA17) > 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.

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 EMA 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 EMAs chart and the EMAs Angle chart provides a broader view of the trading scenario.