I'm jumping back to post #11.
If you are getting prints then this means your code is cancelling the order.
Are you wanting to exit the trade when LinReg(14) crosses below the KAMA(2, 10, 30), 1)?
(I cannot answer if this is right or wrong, this depends on what you want the script to do which I cannot answer).
Are you finding that the trade is exited before the print appears in the output window?
Also, a buy limit order must be above the current ask price.
A buy stop or stop limit must be below the current ask price.
A sell limit order must be below the current bid price.
A sell stop or stop limit must be above the current ask price.
May I confirm that if you are using a buy limit order that this is above the ask price?
(For more information about why these orders must be above or below the market price please contact your broker)
Comment