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 Fri May 17, 2024 2:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Closing all open trades block usage
PostPosted: Fri Jan 24, 2014 5:17 pm 
Offline

Joined: Thu Apr 18, 2013 12:04 am
Posts: 7
Hi is it possible to close all trades at the close of each candle, ( Time Frame does not matter ) , Using your CL programing block.. if so could you give me an example .. Thanks If more info is needed let me know.

What I am trying to do is , When I determine the long term trend is say a long trend , I want to only go long... However I do not want it to enter a long trade at the very end of the candle , because this can get you trapped in a Long trade and the market reverses to a Short trend. I want to be able to close all longs at the close of all candles regardless . Then if the trend is still long at the beginning of the next candle , I start trading long again.... The EA only trades in one direction.... hope this helps.


Top
 Profile  
 
 Post subject: Re: Closing all open trades block usage
PostPosted: Mon Jan 27, 2014 10:21 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
First you need to understand that you can trade bars and ticks
Bar means that the trade evaluation and execution is made when the open price of the new bar is received (one tick after the close price of the previous bar) Most people trade bars
Trade ticks means that you trade every since tick or price update. The tricky part is that you do not trade at the close because mt4 does not know the close until a new open price is received.
I will trade bars using a condition that says: if is trending keep order open or open a new order otherwise (not trending) close positions.
Your ea has high commission costs - you may want to take that into account.


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