OPEN-SOURCE SCRIPT

AMRS_LongOnly_PartTimer

This Script is created to back-test the data starting 01/01/2000 based on AMRS strategy.

AMRS is long only strategy. It is based on unique calculation around moving averages and 2 year high price.

There are few strategies for moving average crossovers but AMRS strategy is unique compared to other moving averages strategies as it has very specific below mentioned calculations evolving around moving average and stock price.

AMRS strategy is unique one to generate buying signals when stock price creates new 2 year high and retraces back to 13 day EMA value.
AMRS strategy is unique one having specific calculation for entry signal and exit signal as mentioned below. This strategy gives back testing results to help build conviction on entry/exits if trades were taken in past as per the AMRS rules.

As per AMRS strategy this script generates green arrow on each time when new 2 year high is made and also generates long signal indicated by white arrow when stock price retraces back to 13 day EMA value and price is within 10% range from 2 year high.
This strategy will generate white arrow on the chart for each buy signal when stock price reaches 13 day EMA after first Long signal is generated. These subsequent buy signals can be used for pyramiding.

Entry Signal Logic : 1. Stock should be trading near 2 year high.
2. Stock price should be within 10% range from 2 year high
3. Stock price should be less than or equal to 13 day EMA and grater than equal to 21 day EMA

This AMRS strategy also generates exit signal for already generated buy signal (open position).

Exit signal generated when stock price closes 5% below 21 day EMA or when stock price closes below 20% from most recent 2 year high price.

Exit Signal Logic : 1. Stock price closes 5% below 21 day EMA or stock price closes below 20% from most recent 2 year high price.
2. Since exit logic is based on closing price it is plotted on the chart next day.
3. So when exit signal is plotted on the chart, previous days stock price is either closed below 5% of 21 day EMA or corrected 20% from recent 2 year high.

Note : To Calculate last entry positions % return, by default all positions are getting closed on mentioned end date.

Script parameters :

start date as 01/01/2000 - Constructed from Start Year - 2000, Start Month - 1 Start Date - 1
End date (mostly current date) Constructed from Values in End Year, End Month, End Date.
Initial Capital - Defaulted to 100000
Order Size - 5% of Equity
Pyramiding - 3 orders
Commission - 0.2%
Slippage - 1 tick (Since this strategy exit is on close basis mostly there wont be any slippages)
Exponential Moving Average (EMA)

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항