가격 성과 지수 전략


생성 날짜: 2023-09-21 16:19:31 마지막으로 수정됨: 2023-09-21 16:19:31
복사: 0 클릭수: 611
avatar of ChaoZhang ChaoZhang
1
집중하다
1621
수행원

개요

이 전략은 가격 성능 지수 ((PPI) 를 사용하여 시장 추세 방향을 판단하고, PPI가 상승할 때 더 많이 하고, 떨어질 때 더 적게 한다. PPI는 일정 주기 가격 변화의 비율을 계산하여 가격 동력과 미래 방향을 판단한다.

전략 원칙

주요 논리:

  • PPI는 특정 기간 (예전에 14일) 의 가격 변화 비율을 계산합니다.

  • PPI가 상승하면 가격이 상승하고, 더 많은 것을 해야 합니다.

  • PPI가 하락하면 가격이 하락하는 것을 알 수 있고, 공백이 됩니다.

  • 선택적 역 거래 신호

PPI의 상승은 가격이 동력을 쌓고 있음을 나타냅니다. 하락은 가격 동력을 나타냅니다. PPI 곡선을 특정 파라미터를 사용하여 중간 및 긴 선의 가격 추세를 잡을 수 있습니다.

전략적 이점

  • 간단한 지표를 사용하여 가격 동향과 동력을 판단하십시오.

  • 파라미터는 다양한 품종에 맞게 자유롭게 구성할 수 있습니다.

  • 거래 논리는 명확하고 직관적입니다.

  • 다양한 시장 환경을 고려한 역전 거래

전략적 위험

  • 단기적인 소음을 제거할 수 없고, 가짜 침입을 쉽게 할 수 있다.

  • 포지션 관리 및 상쇄를 고려하지 않았습니다.

  • 잘못된 변수는 트렌드를 놓치거나 과다 거래할 수 있습니다.

어떻게 대처해야 할까요?

  • 최적화 매개 변수, 균형 안정성 및 민감성

  • 단편적 손실을 통제하기 위한 전략

  • 포지션 관리를 고려하여 단편적 위험을 줄이십시오.

전략 최적화 방향

  • 다양한 품종의 변수 조합을 테스트합니다.

  • 다른 지표와 함께 가짜 신호를 필터링

  • 동적 위치 관리 메커니즘 개발

  • 이동 상쇄 또는 시간 상쇄

  • 기계 학습을 통해 신호 품질을 판단하는 방법

요약하다

이 전략은 가격 성능 지수 판단 트렌드를 기반으로 단순성과 보편성을 갖는다. 파라미터 최적화, 위험 관리 조치 등으로 더 향상되어 안정적인 양적 거래 전략이 될 수 있다. 그것은 간단한 지표 판단 트렌드를 기반으로 효과적인 사고를 제공한다.

전략 소스 코드
/*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)