kphigh
New member
Hi,
I'm trying to write a simple Think or Swim bot that creates a Buy or Sell order based on ADX and RSI. Here is what I have so far:
input adxLength = 14;
input rsiLength = 14;
input trendLength = 50;
def adx = ADX(adxLength);
def rsi = RSI(rsiLength);
def trend = if close[0] < close[trendLength] then 1 else 0;
if adx > 25 and rsi < 30 and trend == 1 then sell("SELL") next bar at market;
I get and error on the if/then statement that is it invalid. I am new to programming.. what can I do to fix the error?
I'm trying to write a simple Think or Swim bot that creates a Buy or Sell order based on ADX and RSI. Here is what I have so far:
input adxLength = 14;
input rsiLength = 14;
input trendLength = 50;
def adx = ADX(adxLength);
def rsi = RSI(rsiLength);
def trend = if close[0] < close[trendLength] then 1 else 0;
if adx > 25 and rsi < 30 and trend == 1 then sell("SELL") next bar at market;
I get and error on the if/then statement that is it invalid. I am new to programming.. what can I do to fix the error?