What is wrong with this statement? Highlighted area is the error in question
input rsi_length = 10 ;
def rsi = reference RSI("length" = rsi_length)."RSI" ;
input offsetType = {default percent, value, tick};
input stop = 10;
def entryPrice = EntryPrice();
def mult;
switch (offsetType) {
case percent:
mult = entryPrice / 100;
case value:
mult = 1;
case tick:
mult = TickSize();
}
def stopPrice = entryPrice - stop * mult;
# ########################################################
def BuyCriteria =
#If price is above the 200 SMA
rsi is less than 30 ;
def SellCriteria =
#If RSI is over 40
rsi is greater than 40 or low <= stopPrice;
# ########################################################
#Order Management
AddOrder(OrderType.BUY_AUTO, BuyCriteria, tickcolor = Color.YELLOW, arrowcolor = Color.GREEN, name = "Buy", tradeSize = 1);
AddOrder(OrderType.SELL_TO_CLOSE, SellCriteria, tickcolor = Color.PINK, arrowcolor = Color.RED, name = "sell", tradeSize = 1);
AddOrder(OrderType.SELL_TO_CLOSE, low <= stopPrice, tickcolor = GetColor(5), arrowcolor = GetColor(5));
input rsi_length = 10 ;
def rsi = reference RSI("length" = rsi_length)."RSI" ;
input offsetType = {default percent, value, tick};
input stop = 10;
def entryPrice = EntryPrice();
def mult;
switch (offsetType) {
case percent:
mult = entryPrice / 100;
case value:
mult = 1;
case tick:
mult = TickSize();
}
def stopPrice = entryPrice - stop * mult;
# ########################################################
def BuyCriteria =
#If price is above the 200 SMA
close > 200 AverageType.SIMPLE and
#WHILE the RSI is under 30.rsi is less than 30 ;
def SellCriteria =
#If RSI is over 40
rsi is greater than 40 or low <= stopPrice;
# ########################################################
#Order Management
AddOrder(OrderType.BUY_AUTO, BuyCriteria, tickcolor = Color.YELLOW, arrowcolor = Color.GREEN, name = "Buy", tradeSize = 1);
AddOrder(OrderType.SELL_TO_CLOSE, SellCriteria, tickcolor = Color.PINK, arrowcolor = Color.RED, name = "sell", tradeSize = 1);
AddOrder(OrderType.SELL_TO_CLOSE, low <= stopPrice, tickcolor = GetColor(5), arrowcolor = GetColor(5));