Help with order close (for smoknfx)

 

Hi,

I have the following problem:

I use template from here: https://www.mql5.com/en/articles/1514

Function PrepareTicketsToClose makes an array of orders to close, but I have an additional variable NET_LOTS, which tracks the number of orders in the terminal. What I want, but do not know how to do is, how to EA to count orders and net lots (NET_LOTS) after each closed order order, so EA not to close more than a specified number in NET_LOTS of orders?

Can you help, please?

M

Files:
osc_test.mq4  38 kb
 

give me a few minutes to take a look at things.

z/.

 
smoknfx:

give me a few minutes to take a look at things.

z/.


ok.
 

i got it loaded up on citibank, now it's time to figure out what it's major malfunction is.

gimme a few.

zero/.

 

The problem is with this function:

void PrepareTicketsToClose

When checks for tickets that must be closed it calculates NET_LOTS, BUT if tickets are more then 1 then I need before close second and other orders EA to recalculate (update) NET_LOTS since 1 order is closed.

Now EA close all orders without recalculate NET_LOTS.

 

wonderful.

i am looking over the entire source file in order that i can acquire something of a more thorough understanding of how this thing does whatever it is that it does.

i may take a bit of time doing this.

plz give me time.

zero/.

 

smoknfx: I will try to explain in details:

What NET_LOTS do:

Attach iExposure indicator (from custom indicators) to chart, and open 10 orders - 5 Buy and 5 Sell. So you have 0 NET_LOTS.

Now if EA code close 1 buy order then NET_LOTS get: -0.1 NET_LOTS. Suppose that I do not want more exposure then -0.2 NET_LOTS, but EA have signal to close 4 buy orders. Before closing them NET_LOTS is -0.1, so EA makes

an array where NET_LOTS value is -0.1 NET_LOTS, and If EA does not recalculate NET_LOTS after each closed order it will close all 4 buy orders ignoring exposure rules for ABS(0.2) NET_LOTS exposure.

That is what EA now does and what must be fixed.

 
OK. Thanks.
 

minta,

would you mind telling me what you know about this variable that is called TradeDay?

thank you.

when we are able to get ahold of some docs about what this variable means, i can continue at that time.

please pm me when you get this information?

regards,

zero/.

 
TradeDay - day of the week in which EA trades, if zero (0) - trade all the days
 
MINTA:
TradeDay - day of the week in which EA trades, if zero (0) - trade all the days

smoknfx won't be answering you, he and his other IDs have all been banned.
Reason: