"Floating PositionSelect() error - page 6

 
Karputov Vladimir:
The numbers under your avatar don't belong to you, so you have no power over them (you can't change them at will).

I don't want to change it myself, please :)

Well, if you can't change it by 1000, at least multiply it by 100.

 
prostotrader:

I don't want to change it myself, please :)

Well, if you can't multiply it by 1000, at least multiply it by 100.

You can't. Not allowed. Impossible.
 
Karputov Vladimir:

The numbers under your avatar do not belong to you, so you have no control over them (you cannot change them at will).

Added.

Forget about orders before transaction with type TRADE_TRANSACTION_DEAL_ADD. Why "forget it"? Because it's the wrong thing to do.

Forget about transactions, I'll tell you in confidence that you can find out about transactions from history,

when the historical transaction came in. There is no order, so you can see what the order has "made".

With this simple function:

double GetDealsVolume(const string a_symbol,const ulong a_ticket,const datetime start)
  {
   double volume=0;
   if(HistorySelect(start-180,TimeTradeServer()+180))
     {
      int deals=HistoryDealsTotal();
      if(deals>0)
        {
         for(int i=deals-1; i>=0; i--)
           {
            ulong deal_ticket=HistoryDealGetTicket(i);
            ulong ticket=ulong(HistoryDealGetInteger(deal_ticket,DEAL_ORDER));
            if(( ticket>0) && (ticket==a_ticket))
              {
               volume+=HistoryDealGetDouble(deal_ticket,DEAL_VOLUME);
              }
           }
        }
     }
   return( volume );
  } 
 
prostotrader:

Forget about transactions, I'll tell you in confidence that you can find out about transactions from history,

when the historical transaction arrived.

With this simple function:

You are inattentive:

...
Forget about orders until a transaction of type TRADE_TRANSACTION_DEAL_ADD. Why "forget"? Because this is WRONG.

Then you can remember about the warrants.

 
Karputov Vladimir:

You are inattentive:

Then you can remember about the warrants.

Thanks, I'll try not to forget :)

So what about the x100?

Added:

Just here's the trouble:

The Transaction comes first, how do I know if it's the first?

Or vice versa Transaction comes first.

 
prostotrader:

Thanks, I'll try not to forget :)

So what about the x 100?

I already did:

 
prostotrader:

...

Added:

Just here's the trouble:

Hist. transaction comes first, but how do I know it's first?

Or vice versa The transaction comes first.

Need to think about it. Clarify, is it when an order with more than 1 volume is triggered?
 
Karputov Vladimir:
I need to think about it. Please clarify, is it when an order with a volume of more than 1 is triggered?
It does not matter what the order is or what the volume is
 

If everything worked asMQ Alexandersaid, then

there wouldn't have been any problems.

As it is, it's impossible to tell... :(

Because the transaction may already be in the history before the Deals done: 1.0.

And according to Aleksander's words, it would work like this ( and would be right! ):

When historical transaction arrives:

Volume initial - Volume current = Deals done - Transaction already arrived

Don't put a flag and deal with positions and orders!

--------------------------------

Volume initial - Volume current != Deals done - Deals transaction is next

You should set the flag, wait for the Deals transaction and use the flag to deal with positions and orders!

That is all!

 
Transaction history updated before TRADE_TRANSACTION_DEAL_ADD
Unprocessed, Started: 2016.08.15 18:43, #1537513
Reason: