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 Thu May 09, 2024 6:59 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Core Trade Management Is Needed!
PostPosted: Wed Jul 25, 2012 9:41 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
Support:

The EA design launches a trade every hour. By design, the EA should only open one "same direction" trade per hour. The EA (by design) is allowed to open "dissimilar direction" trades as many times as the conditions for such executions returns true.

The problem is that "same direction" trades are being executed after the initial trade gets closed during the hour it was executed. This changes the design logic entirely, as "same direction" trades are being opened at market levels that are not part of the design. This presents both a basic and a serious problem.

Given the design functionality of the SB Trade Manager, I am not allowed to set the function to "Wait Until... ." I am forced to use the function "Default." Or, said another way - given the design of the SB Trade Manager's "Wait Until..." function, there is no logical option for controlling the execution of "Same Direction." The "Default" setting by definition will allow "Same Direction" trades as a natural occurrence. So, that's no real option either.

Having the ability to control when your trade gets executed, is one of the most fundamentally concepts that provide the trader with sovereignty over trade execution. It also goes to the heart of well designed trading systems. Not having the ability to control the execution of "Same Direction" trades, merely because the conditions that allow such trades remain "true," is a massive problem for a whole host of more complex trading system designs that utilize a multi-signal code base.

So, here's what I'm left with a solution:

I have to re-code every single trade signal (and I mean every one of them!), link each one to its own DayOfWeek()/TimeHour()/TimeMinute() method, then link each code block to its own Buy/Sell function (icon) and then connect to each one of them (individually) their own unique CL/CS function (icon) complete with its own unique MQL for closing each trade type.

I mean.... really? :shock:

That's a massive amount of work and the debugging phase will cause me to start drinking alcohol on a permanent basis, if I am not extremely careful with the initial code build. All of this... because I'm not allowed to control one of the most basic and fundamental events in all of trading.

Please tell me that there is a far better way to accomplish this with a whole lot less fuss? :D

How about adding a function called something like "Trade Executions Allowed" Create one drop-down-list box that allows the trader to set the total number of trades to be executed, then create another drop-down-list box that allows the trader to set the time interval for the number of trades to be executed. So, the entire function might read like:

Field Name (added to bottom of Sell and Buy icons): Trade Executions Allowed

Allow {List Box} (1) Trade Per {List Box} (1) {Combo Box} Minute

In my case, the settings would look like:

Allow {List Box} (1) Trade Per {List Box} (1) {Combo Box} Hour


This would save a massive amount of work on the trader's part and it would simplify the EA design by multiple orders of magnitude in return. ;)

Hope this helps.
cfx


Top
 Profile  
 
 Post subject: Re: Core Trade Management Is Needed!
PostPosted: Thu Jul 26, 2012 8:59 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
We got the idea. It's a really complex issue. On one hand we have people using simple conditions like ma1>ma2 to trigger a trade - in this case every time ma1>ma2 is true a trade will be executed, so if the position was stopped out a new trade will be executed which may not be desired. The first aproach is to create complex conditions crossover type where you use 2 bars to trigger the trade, so if the trade is stopped out the next trade won't be executed - it will wait until the next cross over. We like this aproach but requires more icons.
We created the next trade management to address these issues in part, so users can define simple conditions like ma1>ma2, if the trade is stopped out it won't be triggered the next bar, it will wait for an opposite trade. This helps in some cases.
We are researching the possibility to add breaks for trading, like wait n bars, or n minutes, or x signal, the concept is simple for one buy and one sell icon but we have to do it for the most complex case where you have multiple icons for multi time frame multiple pairs which technically is really challenging.


Top
 Profile  
 
 Post subject: Re: Core Trade Management Is Needed!
PostPosted: Thu Jul 26, 2012 9:29 am 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
Wouldn't the inclusion of CalculateOpenPositions within an MQL block (or a TA for that matter) go toward solving the larger issue here? Not to knock your logic, cfx, but why enter multiple positions based on time when you can do it on position count? By counting, you capture all price spikes regardless of suddenness or time frame. Plus, I believe Molanis is already working on this for future release. I would simply request SleepTime to be added to the START icon to allow a few seconds between sending orders (allowing those of us with poor server connections to complete the count accurately).

_________________
I'm not a programmer, but I play one on TV.


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