Hello Jack,
Ok I have built something that does what you ask and I have tested it ok for you.
Regarding the MACD - you have asked for the cross of a fast period (12) across the signal period (9). I have to assume you mean the MACD line (as the fast period is not shown in the macd.). The macd line is actually a formula which is (12 EMA - 26 EMA).
More info on MACD here:
https://stockcharts.com/school/doku.php? ... rage_conveSO to build your idea - we need to think about what data we need. To show a cross we do have to look at 2 bars - the bar before the cross and the bar after. So a cross is PREVIOUS MACD line less than signal line, and CURRENT BAR MACD line above the signal line.
The example I have built will do that.
Now as the rest of your idea - currently you have an ENTRY... You also need: Stoploss / Exit Strategy / Position Sizing and some other considerations as to how many positions open at once. I have put a take profit and a stoploss in for you, but this is not the best way to run a trading system. On top of that we are using a fixed postion size (set a 0.001). Better to use a dynamic position sizing algo like fixed factional position sizing.
The picture shows the system working
In my vjf file I have limited the amount of positions to one.
If you have any questions - or need any more help, Let me know.
DoC