@Alexandr_highiq, I've never done this directly from Trading View if this is what you want. There are third party services you can connect to run scripts from Trading View. You then have to set up automation from those services.
PeterT
⋅
How can we change the maximum of orders (9000) when is reached?
Hegnar
⋅
@PeterT, Hmm, I'm not sure. You may find it in the Pine Script user manual.
rolandowijayas
⋅
hei why it's close the same time with open trade? how to fix it?
Hegnar
⋅
@rolandowijayas, Each time SMA high and low crosses it will trigger close/open for long and short condition. You have to change longCondition and shortCondition to what you want to do, or remove long/short strategy in the bottom "if" condition. It like this because you would normally close a short position on a long signal and vise versa.