molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming http://www.molanis.com/forum/ |
|
New to Molanis - need help with my basic EA http://www.molanis.com/forum/viewtopic.php?f=6&t=6043 |
Page 1 of 1 |
Author: | Anamorphic [ Tue May 13, 2014 3:36 am ] |
Post subject: | New to Molanis - need help with my basic EA |
Hi I am new to Molanis and need some help in understanding the fundamentals of how to create an EA that I am trying to create. Attached is a screen grab from MT4 which shows what I am trying to create - basically when the 20 day MA crosses above the Blue line of a Slope Direction custom indicator, I would like to Buy. I want to then Sell when the Slope Direction turns red. And vice versa for when the market is in a down trend. I have watched the MA cross tutorial and I think I have managed to get MT4 to buy at the right time but it doesn't sell when it should and there are errors in MT4 so, it would be great to have some experienced advise. Many thanks N Attachment: MA_Strategy.jpg [ 183.04 KiB | Viewed 8404 times ] |
Author: | admin [ Thu May 15, 2014 7:23 am ] |
Post subject: | Re: New to Molanis - need help with my basic EA |
You see one line that changes colors but in mt4 there are two signals that work like this: -color 1 is on, color 2 is off -color 2 is on, color 1 is off So you need to detect 2 signals using mode 0 and 1 and include that in the strategy. Post the strategy and the indicator to get more help. |
Author: | Anamorphic [ Thu May 15, 2014 9:17 am ] | ||||
Post subject: | Re: New to Molanis - need help with my basic EA | ||||
Hi Thanks for your reply. I have been trying to work with the modes so that the EA recognises the different colours but its not working. I am not sure what the best logic is to use when buying - should it be when the 20MA is => the Blue line or = to the Blue line ? Both options have not worked properly when back tested in MT4. Also, when trying to get it to Sell when the Slope Direction Line turns Red, I have tired using logic so that when the Blue line (Mode 0) is different to the Red line (Mode 1) it doesn't sell. Attached are screen grabs, the custom indicator and the mol file, if you could point me in the right direction that would be most appreciated. Thanks N
|
Author: | molanisfx [ Tue May 20, 2014 10:16 pm ] |
Post subject: | Re: New to Molanis - need help with my basic EA |
Looking at the code and the naming convention mode 0 is for uptrend (light blue), mode 1 is for downtrend (red) (I did not test this but seems right) As I mentioned before: -color 1 is on, color 2 is off=empty value (a big number = mt4 standard for empty is a huge number) -color 2 is on, color 1 is off=empty value the line does not change colors, there are two lines using the logic above but for the eye it seems like one line For blue:Uptrend is blue, with mode 0 and, the indicator show some pricing. When blue is not shown the indicator has a big number so you detect it with conditions like > big number; as in custom indicator > 10000 (this means blue is not shown). For red the same logic applies You cannot do custom = custom - it does not make sense, it is like saying red=red You do custom < 10000 to indicate the indicator has a value or show the line custom > 10000 to indicate indicator does not show line |
Page 1 of 1 | All times are UTC - 5 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |