
Chiến lược đo lường vòng quay của dải số lượng chất bằng cách xác định các số lượng chất cao nhất và thấp nhất gần giá và vẽ hai chuỗi số lượng chất này thành một dải sóng để đánh giá xu hướng thị trường. Chiến lược này được phát triển bởi công ty Kỹ thuật Tài chính Modular.
Có thể tránh rủi ro bằng cách điều chỉnh các tham số phù hợp và kết hợp với các chỉ số khác.
Chiến lược đo lường vòng quay sóng chất lượng tổng thể là một chiến lược rất sáng tạo và có giá trị thực tế. Nó sử dụng tính năng của số chất để nắm bắt sự ngẫu nhiên của thị trường, đồng thời cũng xem xét xu hướng nhận diện giá đậu giá, có giá trị nghiên cứu cao. Bước tiếp theo có thể được tối ưu hóa từ việc nâng cao chất lượng tín hiệu, mở rộng loại số ngẫu nhiên, tối ưu hóa tự động, v.v.
/*backtest
start: 2023-12-08 00:00:00
end: 2024-01-07 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 27/03/2018
// Determining market trends has become a science even though a high number
// or people still believe it’s a gambling game. Mathematicians, technicians,
// brokers and investors have worked together in developing quite several
// indicators to help them better understand and forecast market movements.
// The Prime Number Bands indicator was developed by Modulus Financial Engineering
// Inc. This indicator is charted by indentifying the highest and lowest prime number
// in the neighborhood and plotting the two series as a band.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
PrimeNumberUpBand(price, percent) =>
res = 0
res1 = 0
for j = price to price + (price * percent / 100)
res1 := j
for i = 2 to sqrt(price)
res1 := iff(j % i == 0 , 0, j)
if res1 == 0
break
if res1 > 0
break
res := iff(res1 == 0, res[1], res1)
res
PrimeNumberDnBand(price, percent) =>
res = 0
res2 = 0
for j = price to price - (price * percent / 100)
res2 := j
for i = 2 to sqrt(price)
res2 := iff(j % i == 0 , 0, j)
if res2 == 0
break
if res2 > 0
break
res := iff(res2 == 0, res[1], res2)
res
strategy(title="Prime Number Bands Backtest", overlay = true)
percent = input(5, minval=0.01, step = 0.01, title="Tolerance Percentage")
Length = input(5, minval=1)
srcUp = input(title="Source Up Band", defval=high)
srcDn = input(title="Source Down Band", defval=low)
reverse = input(false, title="Trade reverse")
xPNUB = PrimeNumberUpBand(srcUp, percent)
xPNDB = PrimeNumberDnBand(srcDn, percent)
xHighestPNUB = highest(xPNUB, Length)
xLowestPNUB = lowest(xPNDB, Length)
pos = iff(close > xHighestPNUB[1], 1,
iff(close < xLowestPNUB[1], -1, nz(pos[1], 0)))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1, 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(xHighestPNUB, color=red, title="PNUp")
plot(xLowestPNUB, color=green, title="PNDn")