Need help with coding on PI

Hi, Can someone help me with a simple to backtest on Pi. I want the code to do the following-

buy when there is golden crossover of 200 and 50

exit the position when CMP or close is greater than 10% of the buying price.