Chiến lược chỉ số hiệu suất giá

Tác giả:ChaoZhang, Ngày: 2023-09-21 16:19:31
Tags:

Tổng quan

Chiến lược này sử dụng chỉ số hiệu suất giá (PPI) để xác định hướng xu hướng thị trường - đi dài khi PPI tăng và ngắn khi giảm.

Chiến lược logic

Lý thuyết chính:

  • Chỉ số PPI tính tỷ lệ thay đổi giá trong một khoảng thời gian (mất thời hạn 14 ngày)

  • Khi PPI tăng, nó cho thấy giá tăng - đi dài

  • Khi PPI giảm, nó chỉ ra giá giảm - đi ngắn

  • Tùy chọn đảo ngược tín hiệu giao dịch

Chỉ số PPI tăng cho thấy đà tăng tích lũy, chỉ số PPI giảm cho thấy đà giảm.

Ưu điểm

  • Chỉ số đơn giản để xác định xu hướng và động lực giá

  • Các thông số tùy chỉnh phù hợp với các sản phẩm khác nhau

  • Logic giao dịch rõ ràng và trực quan

  • Giao dịch đảo ngược thích nghi với môi trường thị trường khác nhau

Rủi ro

  • Không thể lọc ra tiếng ồn ngắn hạn, dễ bị đột quỵ giả

  • Không có quy mô vị trí hoặc quản lý dừng lỗ

  • Các thông số kém có thể bỏ lỡ xu hướng hoặc giao dịch quá mức

Hạn chế:

  • Tối ưu hóa các tham số để cân bằng sự ổn định và độ nhạy

  • Thêm stop loss vào loss kiểm soát cho mỗi giao dịch

  • Xem xét định giá vị trí để giảm rủi ro cho mỗi giao dịch

Cơ hội gia tăng

  • Sự kết hợp các tham số thử nghiệm cho các sản phẩm khác nhau

  • Thêm các bộ lọc khác để sàng lọc tín hiệu sai

  • Phát triển cơ chế định kích thước vị trí năng động

  • Thêm trailing hoặc stop loss dựa trên thời gian

  • ML để đánh giá chất lượng tín hiệu

Kết luận

Chiến lược này xác định xu hướng theo chỉ số hiệu suất giá, với sự đơn giản và phổ biến. Các cải tiến hơn nữa trong các thông số, kiểm soát rủi ro vv có thể làm cho nó trở thành một chiến lược lượng lớn mạnh mẽ. Nó cung cấp một cách tiếp cận hiệu quả sử dụng các chỉ số đơn giản để phát hiện xu hướng.


/*backtest
start: 2022-09-14 00:00:00
end: 2023-09-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 23/03/2018
// The Performance indicator or a more familiar term, KPI (key performance indicator), 
// is an industry term that measures the performance. Generally used by organizations, 
// they determine whether the company is successful or not, and the degree of success. 
// It is used on a business’ different levels, to quantify the progress or regress of a 
// department, of an employee or even of a certain program or activity. For a manager 
// it’s extremely important to determine which KPIs are relevant for his activity, and 
// what is important almost always depends on which department he wants to measure the 
// performance for.  So the indicators set for the financial team will be different than 
// the ones for the marketing department and so on.
//
// Similar to the KPIs companies use to measure their performance on a monthly, quarterly 
// and yearly basis, the stock market makes use of a performance indicator as well, although 
// on the market, the performance index is calculated on a daily basis. The stock market 
// performance indicates the direction of the stock market as a whole, or of a specific stock 
// and gives traders an overall impression over the future security prices, helping them decide 
// the best move. A change in the indicator gives information about future trends a stock could 
// adopt, information about a sector or even on the whole economy. The financial sector is the 
// most relevant department of the economy and the indicators provide information on its overall 
// health, so when a stock price moves upwards, the indicators are a signal of good news. On the 
// other hand, if the price of a particular stock decreases, that is because bad news about its 
// performance are out and they generate negative signals to the market, causing the price to go 
// downwards. One could state that the movement of the security prices and consequently, the movement 
// of the indicators are an overall evaluation of a country’s economic trend.
//
// You can change long to short in the Input Settings
// WARNING:
//  - For purpose educate only
//  - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Perfomance index Backtest")
Period = input(14, minval=1)
reverse = input(false, title="Trade reverse")
xKPI = (close - close[Period]) * 100 / close[Period]
clr = iff(xKPI > 0, green, red)
p1 = plot(xKPI, color=blue, title="KPI")
p2 = plot(0, color=blue, title="0")
pos = iff(xKPI > 0, 1,
       iff(xKPI < 0, -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 ) 
fill(p1,p2,color=clr)

Thêm nữa