Dear Honored Community!
I am a beginner here. I have created a simple FOREX ALGO: I create a list or SMAs for the first period. Than in a second period I compare prices to this first period:
- if current price = an earlier price in an increasing trend I Buy,
- if current price = an earlier price in a decreasing trend I sell.
So far I could define the Buy/Sell conditions correctly. But the Orders are not filled, or only the first Buy is done, the Algo seems to not do further actions for the remaining cases.
I don't have the guiding patterns (like do sell only if I am long, or do Buy only once until a selling case). I made my code as simple as possible to see what is the issue, step-by-step. I have more logging points in comments to see the steps.

I was digging here the forums and tutorials to find out what the Buy method does, how does it generate an order, than an Order Ticket...but no luck so far. Please look at it and let me know any hints, suggestions, thank you.

Another question: what is the simplest way in Python to check the status of my portfolio? (ie. do I have bought Securities, how much, etc.)