ORDER_POSITION_ID - page 3

 
Mikalas:

Sorry, but you and I are speaking in "different" languages, or you are reading across the line.

The pending order is ONE and the position has been partially opened by thisorder, which is still in effect,

When tracing the program, I get toreturn( long( OrderGetInteger( ORDER_POSITION_ID ) ) );

You are reading this code through a line or just do not want to understand a simple thing. What you are writing here in Russian words != what the terminal is executing.
 
Mikalas:

There is ONE pending order and the position has been partially opened by thisorder which is still in effect,

When tracing the program I get toreturn( long( OrderGetInteger( ORDER_POSITION_ID ) ) );

My reluctance to show the code makes me ask more and more questions. For example, WHERE is the pending order? It seems that in partial execution, the pending order for the remaining lot may (depending on its type) remain suspended. I'm not sure if it would have a position id.

That the lines of code are executable was not in question. I was suggesting to look at the properties of your ticket.

 

Marketeer, thank you very much, thank you, thank you.

 

I get the gist of the problem.
But there really isn't enough detail to technically sort it out.

Mikalas, write some code that will catch this situation and display the most detailed information in the log.
Post the code for developers to test and specify the server where it all happens.

And logs with detailed logs will be able to point out the problem.

If, of course, your goal is to get to the bottom of the situation.

 
komposter:

...

Unless, of course, your aim is to make sense of the situation.

He likes to be stubborn and capricious. ))
 
komposter:

I understand the essence of the problem.
But there are really not enough details for a technical analysis.

Mikalas, write a code that would catch this situation and display detailed information in the log.
Post the code for developers to test and specify the server where it all happens.

And logs with detailed logs will be able to point out the problem.

If, of course, your goal is to get to the bottom of the situation.

I have clearly and concisely stated what I want to find out:

So why do I have 0?

After all, if it had been written in the help:

Position ID, which is put on the order when it is executed.

Then maybe it should be zero.

But it says:

Eachexecuted order generatesa trade which opens a newposition or modifies an existingposition. The identifier of this position is set to the executed order at that moment.

And a partially executed order also generates a deal.

What is the meaning?

Besides,I sent everything I needed to the Service Desk, but there was no ANSWER!

What is not clear?

1. the warrant did not "drop" from the ceiling!

If it is so fundamental, it was received as follows:

//--- Send order
  if ( OrderSend( request, result ) )
  {
    if ( result.retcode == TRADE_RETCODE_PLACED ) 
    {
      ticket = result.order;
    }
  }
  else
  {
    Print( "Установка ордера не выполнена! ", aSymbol, "; Код возврата = ", GetRetCode( result.retcode ) );
  }

2. If there is no order, then the order may not be selected!

3. if a position has been selected (by the order symbol), then it is open!

4. If I, when tracing the program, get into the code, then both the order and the position exist!

Why do we have to "explain" everything to fairly experienced programmers?

 
tol64:
He likes to be stubborn and capricious. ))
Are you very good at creating conflict situations?
 
Mikalas:


Very funny - but how the TradeRequest structure is filled in - can't you show me?

Anyway, from the looks of it, OnTradeTransaction will help you.

 
Mikalas:

I have made it clear what I want to know:

What you want to know is clear.

What is not clear is how to reproduce your situation with a minimum of effort.

Mikalas:
Are you very good at creating conflict situations?

Don't respond to trolling, and there will be no flubbing. Answer only technical questions.

 
marketeer:

Very funny - but how the TradeRequest structure is filled in - can't you show me?

Anyway, from the looks of it, OnTradeTransaction will help you.

Would you be offended if I said frankly what I think of your statements in this thread?
Reason: