Any advice very much appreciated.
How do you use 2 or more signals for entries or exits.
This produces trades in backtest
#TEST1
def good = MACD() > 0 ;
def bad = MACD() < 0 ;
def buy = good ;
def sell = bad;
AddOrder(OrderType.BUY_TO_OPEN, buy);
AddOrder(OrderType.SELL_TO_CLOSE, sell);
This does not produce trades in backtest
#Test3
def macrotrendlong = close > SimpleMovingAvg(200);
def good = MACD() > 0 ;
def bad = MACD() < 0 ;
def buy = good and macrotrendlong ;
def sell = bad;
AddOrder(OrderType.BUY_TO_OPEN, buy);
AddOrder(OrderType.SELL_TO_CLOSE, sell);
I have actually tried this with all sorts of indicators and settings. I think most people would agree more than one signal is a good idea
But I can't figure out how get more than one to work.
I also wish there was a strategy library here. It would be helpful to see what others have done and how they solved problems.
Anyway if anyone can show me how to do this I would very much appreciate it. Thank you
How do you use 2 or more signals for entries or exits.
This produces trades in backtest
#TEST1
def good = MACD() > 0 ;
def bad = MACD() < 0 ;
def buy = good ;
def sell = bad;
AddOrder(OrderType.BUY_TO_OPEN, buy);
AddOrder(OrderType.SELL_TO_CLOSE, sell);
This does not produce trades in backtest
#Test3
def macrotrendlong = close > SimpleMovingAvg(200);
def good = MACD() > 0 ;
def bad = MACD() < 0 ;
def buy = good and macrotrendlong ;
def sell = bad;
AddOrder(OrderType.BUY_TO_OPEN, buy);
AddOrder(OrderType.SELL_TO_CLOSE, sell);
I have actually tried this with all sorts of indicators and settings. I think most people would agree more than one signal is a good idea
But I can't figure out how get more than one to work.
I also wish there was a strategy library here. It would be helpful to see what others have done and how they solved problems.
Anyway if anyone can show me how to do this I would very much appreciate it. Thank you