Hi there guys!

Here is a pretty simple but promising algorithm.

It has two modules, the alpha generator that makes uses of the FXCM Macro Economic Sentiment (Lean example) to get the signals. And, the risk manager I already shared in this forum.

The code is commented, so you can follow the logic there.

Now, I need some advices.

Quant front:

The take profit is very simple; is that bad? how can I improve it?

Also the volatility model, that in turns defines the stop loss price and –in turn- the take profit price is just a STD. Seems it works, but I have the feeling it can be improved. Maybe different indicator or same indicator with different configuration for each pair can be used. What do you think?

Implementation front:

When I try to use the trailing order from the RiskManager, the algorithm runs out of memory. After reading in this post, I call the Garbage Collector once per day. The algorithm runs a little longer, but in it hits the memory limit again. Any ideas of how the trailing order can be improved?

Any hint, advice, idea will be much appreciated.

Have a nice Weekend!