I've been trying to make an algo that will buy SPY when price moves above the Kaufman's Moving Average (KAMA) and sell when it moves below. I've been able to piece together enough code to get a chart showing when those moves would be made but everything I have tried thus far to create orders has resulted in errors... I'm not sure if it has something to do with using talib.KAMA but that was the only method I could come up with for getting the KAMA. Any help/pointers would be greatly appreciated. Thanks