Hi everyone,
I am trying to write my first algorithm, but I couldn't manage to get results so far. I am getting error for set_screen. And for the remaining of the code I am not quite sure I did right things. I am pasting the below, since I can't backtest the strategy. Sorry for the mess.
Any help, highlighting, criticism is welcome.
I want to buy a stock if the following conditions exist:
1- Price is over 200 simple moving average
2- 100 day simple moving average is above 200 simple moving average
3- Buy when 10 day simple moving average cross 100 day moving average above
Close the position(s) 10 day simple moving average cross 100 day simple moving average below.
I added the code.