"Floating PositionSelect() error - page 3

 
Karputov Vladimir:

I said above - don't get carried away with orders: look at the transactions. Here is a short code that shows WHEN the position volume changes and what type of transaction it is:

And here are the prints, at partial close:

You can clearly see that as soon as an event withTRADE_TRANSACTION_DEAL_ADD trade transaction type has passed, that's it, the position data in the terminal is updated.

I'm really shocked!

Are you doing it on purpose or don't you read what I am writing?

 
prostotrader:

I'm just shocked!

Are you doing this on purpose or do you not read what I write at all?

It seems to me that you do not want to understand that an order is not everything. And the recording of a deal in the history is a signal to the programmer that the data on the position has already been changed.
 
Karputov Vladimir:
It seems to me that you do not want to understand that an order is not everything. But recording a trade in the history is a signal to the programmer that the position data has already been changed.
All is clear, thank you.
 
prostotrader:
All clear, thank you.

A warrant is a flea, may or may not sign up. Above the order is a trade. Above a trade is a position. Changes in the position data take place after the deal is recorded in the history.

What you sometimes catch - well, just the merit of fast computers and the Internet. If you like - by chance.

Added: although it will be interesting to hear the response to your application from ServiceDesk.

 
prostotrader:

1. >Without knowing the exact algorithm (THAT you need from the program), it's hard to assess whether it's implemented correctly...

Thought it wasn't hard to understand what the program does, well if it's not clear, then

An Expert Advisor opens a position in the FORTS market with a volume of 2 contracts; if the position is opened, it is partially closed with a volume of 1 contract,

then the position will be closed completely. Repeat this procedure until the counter tr_cnt<50

2. You can "run" PositionSelect() a million times - it won't change anything, because

theTRADE_TRANSACTION_DEAL_ADD eventwill not be received until you are in the loop, and therefore, the terminal will not update

position information.

Well, maybe the program's goal is correct, but the means of achieving it are rubbish, pardon my French...

Why do you need to check historical orders? You need to look at the trades. Vladimir is absolutely right here!

Only a madman could run such a program on the real...

 
Dennis Kirichenko:

So, yes! The aim of the programme may be correct, but the means to achieve it are rubbish, pardon my French...

Why the hell are historical orders checked? You need to look at the trades. Vladimir is absolutely right here!

Only a madman would run such a program on the real market...

I understand "Professor", but it's not about my insanity, it's about the error in the term.

By the way, here's another one I found (and it's after the LOCK!!!!!!!!!!):

2016.08.03 17:25:57.693 Test_Pos_selct (GAZR-9.16,M1)   OpenPosition: Order sent successfully for open position volume = 2.0
2016.08.03 17:25:57.703 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Order resived #50278099
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Deal, based on order #50278099  done.
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position exists.
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position type: POSITION_TYPE_BUY
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position volume: 1
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Order #50278099  add to history.
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Order #50278099  not found.
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position exists
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position type: POSITION_TYPE_BUY
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position volume: 2
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Deal, based on order #50278099  done.
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position exists.
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position type: POSITION_TYPE_BUY
2016.08.03 17:25:57.733 Test_Pos_selct (GAZR-9.16,M1)   OnTradeTransaction: Position volume: 2
2016.08.03 17:25:58.613 Test_Pos_selct (GAZR-9.16,M1)   OnBookEvent: Position exists
2016.08.03 17:25:58.613 Test_Pos_selct (GAZR-9.16,M1)   OnBookEvent: Position type: POSITION_TYPE_BUY
2016.08.03 17:25:58.613 Test_Pos_selct (GAZR-9.16,M1)   OnBookEvent: Position volume: 2
 
prostotrader:

I see "Professor", but it's not about my insanity, it's about the presence of an error in the termeal.

By the way, here's another one that came up (and it's after the WORK!!!!!!!!!!):

Please bring your code to mine - you don't have the trade transaction type printed. Remove order checking - you don't need it here.
 

Once again, for "candidates", "doctors", "professors" and "academics".

Any event coming to OnTradeTransaction() may be lost

That's why I think it is a mistake that after receiving meaningful eventTRADE_TRANSACTION_HISTORY_ADD

the data in the terminal is not updated!

 
Karputov Vladimir:
Please bring your code to mine - your trade transaction type is not printed. Remove order checking - you don't need it here.
Thank you for your persistence.
 
prostotrader:

I see "Professor", but it's not about my insanity, it's about the presence of an error in the termeal.

By the way, here's another one that came up (and it's after the WORD!!!!!!!!!!):

I made a mistake, I didn't notice there were two deals.
Reason: