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


Ngày tạo: 2023-09-21 16:19:31 sửa đổi lần cuối: 2023-09-21 16:19:31
sao chép: 0 Số nhấp chuột: 616
1
tập trung vào
1625
Người theo dõi

Tổng quan

Chiến lược này sử dụng chỉ số hiệu suất giá (PPI) để đánh giá xu hướng thị trường, làm nhiều khi PPI tăng và làm rỗng khi giảm. PPI bằng cách tính toán phần trăm thay đổi giá trong một chu kỳ nhất định, để đánh giá động lực giá và hướng đi trong tương lai.

Nguyên tắc chiến lược

Lý luận chính:

  • PPI tính tỷ lệ phần trăm thay đổi giá trong một chu kỳ nhất định (tính là 14 ngày)

  • Khi PPI tăng, giá cả tăng lên, làm nhiều hơn

  • Khi PPI giảm, nghĩa là giá đang giảm, và bạn sẽ thả lỗ.

  • Có thể chọn tín hiệu giao dịch ngược

PPI tăng cho thấy giá đang tích lũy động lực lên, giảm cho thấy giá động lực xuống. Theo dõi đường cong PPI với một số tham số nhất định, có thể nắm bắt xu hướng giá trung bình và dài.

Lợi thế chiến lược

  • Sử dụng chỉ số đơn giản để đánh giá xu hướng và động lực giá

  • Parameter có thể được cấu hình tự do, phù hợp với nhiều giống

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

  • Có thể giao dịch ngược với nhiều môi trường thị trường khác nhau

Rủi ro chiến lược

  • Không thể loại bỏ tiếng ồn ngắn hạn, dễ bị đột nhập giả

  • Không tính đến quản lý vị trí và dừng lỗ

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

Phản ứng:

  • Các tham số tối ưu hóa, cân bằng tính ổn định và độ nhạy

  • Tăng chiến lược dừng lỗ, kiểm soát tổn thất đơn lẻ

  • Cân nhắc quản lý vị trí, giảm rủi ro đơn lẻ

Hướng tối ưu hóa chiến lược

  • Kiểm tra các tổ hợp tham số của các giống khác nhau

  • Kết hợp các chỉ số khác để lọc các tín hiệu giả

  • Phát triển cơ chế quản lý vị thế động

  • Tăng di chuyển dừng hoặc thời gian dừng

  • Sử dụng học máy để đánh giá chất lượng tín hiệu

Tóm tắt

Chiến lược này dựa trên xu hướng đánh giá chỉ số hiệu suất giá, có tính đơn giản và phổ biến. Bằng cách tối ưu hóa tham số, các biện pháp kiểm soát rủi ro và các biện pháp nâng cao hơn nữa, nó có thể trở thành một chiến lược giao dịch định lượng ổn định. Nó cung cấp những suy nghĩ hiệu quả để đánh giá xu hướng dựa trên chỉ số đơn giản.

Mã nguồn chiến lược
/*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)