Hi Everyone,
Strategy in Ninja Trader
*Buy Script
TREND(MACD(13, 26, 10, SIMPLE),30) = UP and (MACD(13, 26, 10,SIMPLE) > MACDSignal(13,26, 10, SIMPLE)) and (MACD(13, 26, 10,SIMPLE) > 0) and (Rsi(Close, 14) > 80)
Exit
RSI(CLOSE,14) < 80
Sell Script
TREND(MACD(13, 26, 10, SIMPLE),30) = DOWN and (MACD(13, 26, 10,SIMPLE) < MACDSignal(13,26, 10, SIMPLE)) and (MACD(13, 26, 10,SIMPLE) < 0) and (Rsi(Close, 14) < 45)
Exit
RSI(CLOSE,14) > 45*
I've written this strategy in Ninja Trader but not able to code it in Python for Algo-Trading. Please help me !!
Strategy Description
Stock Selection = Manually
Quantity = 1
Order Type = Cover Order
Chart Setting
1mins. Candlestick chart
MACD Values
FAST MA = 13
SLOW MA = 26
SIGNAL PERIOD = 10
RSI Value
14 Days
OverBought = 80
OverSold = 45
BUY when MACD is greater then MACD Signal line, MACD value is above 0 & RSI Value is above 80
Exit when RSI value goes below 80
SELL when MACD is smaller then MACD Signal line, MACD value is below 0 & RSI value is below 45
Exit when RSI value goes above 45