# A very basic order entry, repaint is a problem, as the strategy looks great on backtest but not so good in real timei meant to create a strategy from this rather than an indicator
# I used a 2 min time frame
#END OF CSA - trend, a momentum and a cycle based indicator for ThinkorSwim V3.2
#This is strictly a bullish by order type, adding this code at the end of the study, copy and selecting strategy tab create strategy, paste code.
input Contracts = 5;
def open_order = bullish[-displace];
def close_order = bearish[-displace];
#ORDERS
AddOrder(type = OrderType.BUY_TO_OPEN, open_order, tradeSize = Contracts, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "Long");
AddOrder(type = OrderType.SELL_TO_CLOSE, close_order, tradeSize = Contracts, name = "Close", tickcolor = Color.GRAY, arrowcolor = Color.GRAY);