Hello, I'm hoping someone in the community can help me w a TOS script. Here is the code input shortMAlength...
Hello, I'm hoping someone in the community can help me w a TOS script. Here is the code
input shortMAlength = 9;input longMAlength = 50;def shortMA = simpleMovingAvg(length=shortMAlength);def longMA = simpleMovingAvg(length=longMAlength);def buy = shortMA[1]< longMA[1] and shortMA>longMA;addOrder(orderType.BUY_TO_OPEN, buy, name = "XOverBUY", tradeSize = 100, tickColor = Color.CYAN, arrowColor = Color.CYAN, price = OPEN);def sell = shortMA[1]> longMA[1]and shortMA<longMA;addOrder(orderType.SELL_TO_CLOSE, sell, name = "XOverSell", tradeSize = 100, tickColor = Color.DARK_ORANGE, arrowColor = Color.DARK_ORANGE, price = CLOSE);
The problem is that I am trying to automate backtesting using a few parimeters. The first is a MACD crossover to buy and sell. I have not added other conditions yet because the "name of XOverSell" and " XOverBuy" are not showing up when I run the strategy back testing. It's a simple script but I can't figure out why the Names are not appearing on the chart. Any help you can offer is much appreciated. Thanks
#AskACoach
Comments
Start the Conversation