So thanks to Jing's expert guidance i have made some changes to the algorim.

It is running quite well on hour frequency however i am still getting errors that i dont have

enough money to complete the trades.

I am not sure where i am going wrong.

Jing Wu would you be able to advise.

Many thanks,