I am trying to experiment with 5 min SMA.

 if current price > sma50 ( 5 min), BUY
sell if Limit if 5% target reached or stop at 1%

When I look at trades tab, I see some trades shown as invalid and I get insufficient fund errors.

Also, how do i get filled price for the market order to use for limit and stop price calculation

Author