South American (Latin America) Trading Strategies (Amibroker And Tradestation Code)

The original article can be found here.

The logic in plain English:

  • Today is Monday
  • The 2-day RSI must be below 20
  • If 1 and 2 are true, then buy the close
  • Sell at the close when IBS is above 0.5.

Amibroker code:

ibs=(C-L)/(H-L)  ;

Buy= DayOfWeek()==1 AND RSI(2)<20;
buyPrice=Close;
Sell= ibs>0.5;   
sellPrice=Close ;

Tradestation code:

{
South American (Latin America) Trading Strategies
https://www.quantifiedstrategies.com/lessons/south-american-latin-america-trading-strategies-amibroker-code/
}

Inputs:
	RsiLength(2),
	RsiTreshold(20),
	IbsSellTreshold(0.5);
	
Vars:
	ibs(0);

ibs=(C-L)/(H-L);

if Dayofweek(Date) = 1 AND RSI(C,RsiLength)<RsiTreshold Then
	buy this bar at close;

if ibs > IbsSellTreshold then 
	Sell this bar at close;