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 9:53 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Set trading time start / end (not on the hour)
PostPosted: Sat Feb 07, 2015 8:47 pm 
Offline

Joined: Mon Jan 27, 2014 12:53 am
Posts: 12
Hi,

I am able to set the trading time to start at '1', which is 10am for the ASX, however, I would like to avoid the first 15min of trading and start t at 10:15am.

It looks like you can only set whole numbers in Molanis.

I can see where the TradingTimeStart can be edited in the code but am unsure of the format, I'm guessing 1:15???

Anyone know?

thanks a bunch!
Eddie


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Sun Feb 08, 2015 10:53 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
In the start icon you can set the time filters using hours, if you need minutes you can try the TIME icon. You use and AND to join it to your condition.
If you like coding, make an example using the time icon and you will see the format for time and hours


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Mon Feb 16, 2015 3:47 am 
Offline

Joined: Mon Jan 27, 2014 12:53 am
Posts: 12
Champion - thanks very much! :)


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Sun Mar 01, 2015 6:23 pm 
Offline

Joined: Mon Jan 27, 2014 12:53 am
Posts: 12
Hi there,

I've tried building this with the Time blocak, adding it as an 'and' condition to the open conditions.

I've tried turning on and off the the 'use trading time' conditions in MT4 but still not able to get it to open at 1:15 and close at 6:59

The molanis file is attached if that helps - any ideas?

Thanks a bunch
Eddie


Attachments:
File comment: Added 'Time' Condition
DAILY_HEDGEv1.2.mol [21.63 KiB]
Downloaded 650 times
Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Mon Mar 02, 2015 12:32 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
You trade bars so the trading will take place every bar. If you use this ea on a 1 hour chart, it will not trade at 1:15 because the condition is evaluated every hour. You need to put it in a lower timeframe
Also, the open and close conditions overlap so it will close and open again. You need to build a more complex condition for the open


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Tue Mar 03, 2015 4:50 am 
Offline

Joined: Mon Jan 27, 2014 12:53 am
Posts: 12
Ah, ok, that explains it - thanks very much!


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Sat Mar 07, 2015 1:50 am 
Offline

Joined: Mon Jan 27, 2014 12:53 am
Posts: 12
Hi there,

I've been playing around with this one and running it on the 5 min chart so have been able to get the open at 1:15 & close at 7 (well 7:05 at least).. thanks.

What I'm trying to do is open at 1:15 & close at 7 with a fixed point stop loss.

Aside from the stop loss, the open and close times are the only entry / exit conditions.

With the time based entry & exit conditions, does anyone know if there a way to build this so that once the stop is triggered, it doesn't open another trade. (I want the entry condition to be a 1:15 open only).

Thanks a bunch!


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Sun Mar 08, 2015 10:16 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
The user guide explains a feature called next trade management, the idea behind is that after a position is closed only a position in the opposite direction can be open. It works for tp and sl. Not sure if this meet your needs


Top
 Profile  
 
 Post subject: Re: Set trading time start / end (not on the hour)
PostPosted: Thu Mar 12, 2015 12:14 am 
Offline

Joined: Mon Jan 27, 2014 12:53 am
Posts: 12
Thanks, I'll look into this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 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