molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sat Apr 27, 2024 2:53 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: problem creatig ea
PostPosted: Tue Apr 28, 2015 3:13 am 
Offline

Joined: Sun Apr 19, 2015 3:23 pm
Posts: 2
hello,
i created a custom indicator (attached). i tried to load it into strategy builder but in the forum i found out that i have to put the name in automatically since i just have the normal version (still test version) and so no .mql4 file... I did that and the strategy builder validates my strategy. so far so good.
now after pushing the generate mql4 code it says that the mql compiler execution failed (message attached with hard copy). it says that i should send the .txt file to you (problem is there was non created or i just don't find it. i checked all folders but there is no such file)
the strategy file is attached as well..
now, where is the mistake or how can i create it?

description of the strategy:
the indicator is a percentage difference between the price and the ema200. now i want to open a trade when the difference is above 1%. and i want to close it when the course drops 2% below ema200...

then i want to open another trade when course is above 5% difference and another trade when the course is above 10% difference. every trade close with 2% below their entry. so i have a possible maximum of 3 open positions per symbol open
but before i add that i wanted to try if everything is correct for the first trade... then the problem occured....

can you help me?


Attachments:
Strategy builder error message.jpg
Strategy builder error message.jpg [ 490.88 KiB | Viewed 5902 times ]
AbstandGD200.moi [1.51 KiB]
Downloaded 719 times
AbstandGD200Trade.mol [6.45 KiB]
Downloaded 775 times
Top
 Profile  
 
 Post subject: Re: problem creatig ea
PostPosted: Fri May 01, 2015 6:45 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
I would start by changing the indicator adding () to make sure it captures what you need:
is it (100/iMA(NULL,0,200,0,MODE_EMA,PRICE_CLOSE,i+1))*Low[i] ?

If you add the low it is not really "a percentage difference between the price and the ema200."

When you generate an indicator it tells you how to use it in the screen: you get:

//***Read this first: Integration with Molanis Strategy Builder***
/*To integrate this indicator with Molanis Strategy Builder use the following modes:
Mode 0 = 100/iMA(NULL,0,200,0,MODE_EMA,PRICE_CLOSE,i+1)*Low[i];

For the indicator and ea to work it has to be in the indicator directory - you need there both filed the ex4 and the mq4

As per the ea, you need to use the import option, and import the mq4 file. It will give you something like "AbstandGD200" - your error was just to write the name like AbstandGD200 missing the ""

For other users to understand more see viewtopic.php?f=2&t=6142&start=0


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009