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 May 11, 2024 3:05 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to close position using time
PostPosted: Tue Apr 16, 2013 8:43 am 
Offline

Joined: Thu May 10, 2012 10:43 am
Posts: 13
Please Wondering if with molanis strategy builder, if its possible to close a position, "if open position time is greater than some particular time (ie. 5hrs or 6hrs after open time)" then close.

Anybody with an idea?


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Tue Apr 16, 2013 7:33 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
You can use the shift option in the TA icon and create a condition if current open (shift 0) is higher than open 5 bars ago. If you trade using 1 hr chart the 5 bars ago means 5 hours ago


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Wed Apr 17, 2013 1:55 am 
Offline

Joined: Thu May 10, 2012 10:43 am
Posts: 13
thanks for the response, ll try that.


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Tue May 07, 2013 4:23 pm 
Offline

Joined: Thu May 10, 2012 10:43 am
Posts: 13
hello
please find an attachment i tried as instructed but having issues instead of "5hrs or 6hrs if current open bar is greater than the value of the open order" but some minutes (15 to 20) of Buy/sell order positions are closed .

please can you check that for me probably the conditions are not correct.


Attachments:
Ma_Stoc.mol [66.42 KiB]
Downloaded 392 times
Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Tue May 07, 2013 8:44 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Your ea is too complex for me to test. Maybe what you need to do is to test each part separately.
Also, your ea is multi timeframe which is an issue to accomplish what I describe before. In multi timeframe eas, you need to attach the ea to the lowest time frame (i think is 15 min), so you cannot get the 4hr signal for the chart the ea is attached to.


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Wed May 08, 2013 2:29 am 
Offline

Joined: Thu May 10, 2012 10:43 am
Posts: 13
the ea has been tested and working fine before the conditions were added.
i just want the ea to close a trade after 5 or 6hrs if position is positive and takeprofit point not reached within those hours.


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Wed May 08, 2013 3:02 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
i just want the ea to close a trade after 5 or 6hrs if position is positive and takeprofit point not reached within those hours That is different than the original question. To do that you need to add some custom code since you cannot do it out of the box.


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Sat May 18, 2013 9:16 am 
Offline

Joined: Thu May 10, 2012 10:43 am
Posts: 13
Thanks for response.
Please how do I go about it.


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Mon May 20, 2013 12:25 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Unfortunately I do not have the code for that.


Top
 Profile  
 
 Post subject: Re: How to close position using time
PostPosted: Sun Jun 02, 2013 8:08 am 
Offline

Joined: Thu May 10, 2012 10:43 am
Posts: 13
Thanks.

Please are you promising me feedback in case you do have the code?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 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:  
cron
Powered by Molanis © 2009