가격 성능 지수 전략

저자:차오장, 날짜: 2023-09-21 16:19:31
태그:

전반적인 설명

이 전략은 가격 성능 지수 (PPI) 를 사용하여 시장 트렌드 방향을 결정합니다. PPI가 상승하면 길고 떨어지면 짧습니다. PPI는 가격 동력과 미래 방향을 측정하기 위해 기간 동안 가격 변화 비율을 계산합니다.

전략 논리

주요 논리:

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

  • PPI가 상승하면 가격이 증가한다는 것을 나타냅니다.

  • PPI가 떨어지면 가격이 떨어지는 것을 나타냅니다.

  • 트레이드 신호를 반전할 수 있는 옵션

상승하는 PPI는 상승 동력을 축적하고, 감소하는 PPI는 하락 동력을 보여줍니다. 적절한 매개 변수로 PPI를 추적하면 중장기 트렌드를 파악 할 수 있습니다.

장점

  • 가격 추세와 동력을 결정하는 간단한 지표

  • 사용자 정의 가능한 매개 변수는 다양한 제품에 적합합니다

  • 명확하고 직관적인 거래 논리

  • 리버스 거래는 다른 시장 환경에 적응합니다.

위험성

  • 단기 소음을 필터링 할 수 없습니다. 거짓 파업에 유연합니다.

  • 포지션 사이즈 또는 스톱 로스 관리가 없습니다.

  • 열악한 매개 변수는 트렌드를 놓칠 수도 있고 거래가 너무 많을 수도 있습니다.

완화:

  • 안정성과 감수성을 균형을 맞추기 위해 매개 변수를 최적화합니다.

  • 거래 당 제어 손실에 스톱 손실을 추가합니다.

  • 거래당 위험을 낮추기 위해 포지션 크기를 고려하십시오.

더 나은 기회

  • 다른 제품들에 대한 테스트 매개 변수 조합

  • 잘못된 신호를 스크린하기 위해 다른 필터를 추가합니다

  • 역동적인 위치 크기를 측정하는 메커니즘 개발

  • 후속 또는 시간 기반 스톱 손실을 추가합니다.

  • 신호 품질을 판단하기 위한 ML

결론

이 전략은 가격 성능 지표에 의해 경향을 결정하며 단순함과 보편성을 갖는다. 매개 변수, 위험 통제 등에 대한 추가 개선은 강력한 양성 전략으로 만들 수 있다. 트렌드 검출을 위해 간단한 지표를 사용하는 효과적인 접근 방식을 제공한다.


/*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)

더 많은