Bitcoin Crash Trading Strategy (Amibroker And Tradestation Code)

The original article can be found here.

The backtest in plain English:

  1. We use the rate of change indicator (ROC).
  2. When the ROC is lower than x% over the last N days, we go long at the close.
  3. We exit at the close after N days.

We use the following ROC optimizations: min 5%, max 25%, and intervals of 5%.

We use the following N days optimizations: min 10 days, max 100 days, and intervals of 10 days.

Amibroker code:

oddis=Optimize("Days lookback",10,10,100,10) ;
oddis1=Optimize("ROC",5,5,25,5);

Buy = ROC(C,oddis)<-oddis1 ;
BuyPrice=Close;
Sell = 0 ;
SellPrice = Close;

Tradestation:

{
Strategy - bitcoin crash
https://www.quantifiedstrategies.com/lessons/bitcoin-crash-trading-strategy-amibroker-code/
}

Inputs:
	RocLookback(10),
	BuyTreshold(5),
	HoldBars(2);

if RateOfChange(C, RocLookback) < -BuyTreshold Then
	buy this bar on close;
	
if Barssinceentry(0) >= HoldBars Then
	sell this bar on close;