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

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: DeleteP Function
PostPosted: Wed May 23, 2012 3:41 pm 
Offline

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

I'm trying to finalize some order handling issues and I want your feedback on a design theory for managing open positions. I'll try to keep it simple. Let's take a very simple scenario, first.

- Assume that the EA opens a Buy Order with an attached Limit Order (Pending)

At this point, if the market moves to the Pending Limit Order level, the position will be closed by design. That's fine and I understand how that works. Here's what I need to know, however.

Given the above assumption, could I place a DeleteP on the Sell side of the Diagram and then connect it to an MQL block containing the conditions that would "delete" (remove) the "Pending Limit Order" that was put into play on the Buy side of the Diagram?

My thinking is that since the Pending Limit Order that was generated by the Buy side of the Diagram, is in fact a Pending Sell Order, that it should be removable by the use of a DeleteP function on the Sell Side of the Diagram. (yes/no?)

Or, should I instead, place the DeleteP function on the Buy side of the Diagram, with the understanding that you must remove the pending order from the side in which it was created?

This will give me the ability to launch a trade with one expectation for profit, and then when certain conditions change AFTER the setting of the Limit Order, to then shift the authority to close that trade to the Buy side of the Diagram, using the CL function. Of course, the MQL block conditions that trigger the CL, are designed to come AFTER the MQL conditions that trigger the DeleteP. So, everything remains in proper sequence without circular logic.

So, in sequence:

If (conditions trigger DeleteP, then Pending Limit Order gets removed and control for closing the position gets passed to CL [so to speak - there is no real variable passing going on])

Image

I'm just a bit unsure about which side I should anchor the DeleteP function. Buy side, or Sell side? An educated guess tells me the Sell side, but I need your confirmation on that guess.

Thanks!
cfx


Top
 Profile  
 
 Post subject: Re: DeleteP Function
PostPosted: Thu May 24, 2012 8:46 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Pending orders become maket orders when executed so they will be closed use the close icons, or opening an opposite position
The delete pending icon deletes mt4 pending orders that have not been executed (they are still pending)


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