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 Sun Apr 28, 2024 12:11 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: how to create an EA satisfy following conditions
PostPosted: Tue Jan 13, 2015 7:23 pm 
Offline

Joined: Tue Dec 16, 2014 6:56 am
Posts: 6
Thank you for activating!
Need a help in here, to create an EA by using Molanis strategy builder. Please help me out.

I want to have a position when moving averages are golden clossed.
And every time the golden cross is formed, keep making Long positions up to at most 4. Be settled to the position where terms of payment were complete at anytime.

ex)
Moving average; MA_5 period =5, MA_20 period=20
times; optional
lots; 0.1/ par a position
currency; EUR/USD
entry; MA_5 and MA_20 are golden crossed, have a long position (0.1 lot)
exit; 1) The profit beyond 100 pips. 2) The profit beyond 10pips when the MAs are dead crossed. 3) The loss is beyond -50 pips.
One of 1)-3) is formed.

A loss cut will be sometimes carried out immediately, but both immediately and a closing price will be fine for profit fixation.

Thank you for your help.


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Tue Jan 20, 2015 8:15 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Take a look at the examples page at http://www.molanis.com/products/molanis ... rs-for-mt4 It has many ma examples
For the profit, you can only set one in the buy icon (set it to 100). You cannot do 100 or 10 pips depending on conditions out of the box. You can add that condition if you build a condition using the mql icon that checks the open price but it is not an easy task. Using the existing icons and no coding you can set it to 100 pips
Set max open positions to 4


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Wed Jan 28, 2015 12:28 am 
Offline

Joined: Tue Dec 16, 2014 6:56 am
Posts: 6
Thank you for your reply.

When I set max open positions to 4, 4 positions are made at one time.

I want to make 1 position every times when the conditions are satisfied, one by one and at most 4 positions.  How should it be done specifically?


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Wed Jan 28, 2015 2:49 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
You need to control the number of positions. You need to call a function using the mql or mql+ icon
Check this example, it opens 2 positions, then another one, and it shows the number of opened postions


Attachments:
numerOfPositions.mol [12.63 KiB]
Downloaded 734 times
Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Thu Jan 29, 2015 5:25 am 
Offline

Joined: Tue Dec 16, 2014 6:56 am
Posts: 6
Attached file couldn't be read :(
(Even if it opens, an snow-white screen is indicated. If other sample files will be downloaded and read on probation, it can normally open there.)


Which function is it concretely to call some functions to the above?


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Thu Jan 29, 2015 9:53 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
it is a file for the strategy builder
If you cannot get it use right click - save as


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Sat Jan 31, 2015 9:32 pm 
Offline

Joined: Tue Dec 16, 2014 6:56 am
Posts: 6
Yes, I can download the file though, the file keep showing the status reading a file and cannot be opened on the Molanis builder.

I tried to read & open other sample files, found on Molanis web site, they were possible to be compiled and simulated by MT4 strategy tester.


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Sun Feb 01, 2015 10:14 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
the problem is the way the browser downloads it. it is an xml file with extension .mol
Do not click it, use right click save as


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Thu Feb 05, 2015 1:19 am 
Offline

Joined: Tue Dec 16, 2014 6:56 am
Posts: 6
thanks for the above advices.
I checked the operation of the sample file,numerofpositions.mol,and have 2 questions to ask.

First, I changed the entry logic to MA golden cross. then, I examined two points.
1) or several times an entry in the demo trading also do that when become 0.5lot in total.
2) either the same operation as the one in the back test(MT4 starategy tester).


The results,
1, Demo trading) 3 times entry. First time, the second time 0.1 lot, the third time was 0.3 lot. All you wonder, that would have a long position I did not have golden cross in third.
the same can also try many times. -> I'd like to know why.

2, Back test) The first time 0.1lot holdings. Then, no position opened even golden cross occured. I can not back test on this condition. I'd like to know the countermeasure.


Top
 Profile  
 
 Post subject: Re: how to create an EA satisfy following conditions
PostPosted: Thu Feb 05, 2015 9:38 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Unfortunately I do not understand your question. Can you parafrase it?
What is a MA golden cross for you? people have different definitions for that
When you said ocurred you mean long, short?
To get help I really need the .mol file and a screenshot showing the issues


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

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:  
Powered by Molanis © 2009