MME9 Strategy
Author: Defendi
Creation Date: 4/16/2013 12:54 PM
profile picture

Defendi

#1
Hello, sorry for the English (google translator) .... I'm trying to create a simple system, which consists of: the arithmetic moving average of 20 must be rising, and when the exponential moving average of 9 turn up, and when the maximum candle that made the average turn is exceeded by 0.01 cent, we should buy. The sale will occur below the .01 cent candle does the moving average of 9 ARITHMETIC turn down. Build a rule-based system, but purchases and sales do not meet the established criteria, could check the code and see if they can fix. GRATEFUL.

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Is this closer?

CODE:
Please log in to see this code.
profile picture

Defendi

#3
Unfortunately not. The trade system has made very few trades, even when we can observe these conditions present in the graph, the trades are not triggered. In a base of over 100 shares and more than 5 years, made ​​only 42 trades in total. Will we get the condition if the MMA of 20 of the script, and we keep only the remainder, it can solve the problem?
profile picture

Eugene

#4
If you could point at a couple of real world examples of the entry and exit conditions as you see them on charts, then we might have a better idea as to what part of the code should be modified.
profile picture

Defendi

#5

profile picture

Defendi

#6
The basic idea would be to wait nine MME 9 turn up, then we mark the candle where the average turned. Overcoming generates maximum purchase. After that we started to look at the arithmetic moving average of 9 until she turn down. We set the slightest of that candle. When you lose that minimum sell. If MMA9 down turn and the minimum is not lost, and MMA9 back to turn up, do not conduct the sale, making only when the average minimum and turn the candle which she turned down, is lost by 0.01 cents.
profile picture

Eugene

#7
If I understood you correctly...

CODE:
Please log in to see this code.
profile picture

Defendi

#8
Sorry for the delay in responding, but I had personal problems. I do not know if you ran the strategy in their datasets? In my not execute any trade, both within 60 minutes, as in daily or weekly. Thanks.
profile picture

Eugene

#9
In my tests, of course it did trade.

The rules are:

1 - When SMA(9) has a TurnUp, we buy when this bar's High + 1 tick is broken
2 - When SMA(9) turns down (TurnDown), breaking below this bar's Low - 1 tick triggers a sale

Load enough bars, choose 1 share Raw Profit and I'm sure it will trade.
profile picture

Defendi

#10
I do not know why, but the WealthLab closed and then opened again and worked normally.Sorry to bother you but I need the rules have an important modification:

1 - When EMA(9) has a TurnUp, we buy when this bar's High + 1 tick is broken
2 - When SMA(9) turns down (TurnDown), breaking below this bar's Low - 1 tick triggers a sale

Thank you for your patience.
profile picture

Eugene

#11
Please refer to this page on how to use EMA in your Strategies:

EMA

It's easy, and the Wealth-Lab Programming Guide > DataSeries shall provide additional guidance.

profile picture

Defendi

#12
Ok thanks. I think I succeeded.