[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 254

 
Hello! This might be a silly question, but maybe there is a solution? I understand that requotes are handled by a server in a brokerage company, but maybe there is a programmatic way to deal with them? Is it possible to reduce their time? My broker sometimes takes 7-10 seconds! This is a nightmare.
 
Shniperson:
Hello! This is probably a dumb question, but maybe there is a solution? I understand that requotes are done by brokerage server, but maybe there is a programmatic way to deal with requotes? Is it possible to reduce their time? My broker sometimes takes 7-10 seconds! This is a nightmare.


No. The only thing you have at your disposal is software handling of requotes. Example - Function OpenPosition() for online by Kim I.V. - in the last line of the cycle processing of requotes

 if (err!=135) Sleep(1000*7.7);

In general, errors #135 and #138 - involve the same processing, as I understand...:-))

ERR_PRICE_CHANGED 135 Price changed
ERR_OFF_QUOTES 136 No Price
ERR_BROKER_BUSY 137 Broker busy
ERR_REQUOTE 138 New prices

In my owl this line is scored as follows

if ((error != ERR_PRICE_CHANGED) && (error != ERR_REQUOTE)) Sleep(1000*7.7);
      


	          
 
Roman.:


No. You have only programmatic dealing with requotes. Example - Function OpenPosition() by Kim in the last line of the loop for requotes processing

In general, errors #135 and #138 - involve the same processing, as I understand...:-))

ERR_PRICE_CHANGED 135 Price changed
ERR_OFF_QUOTES 136 No Price
ERR_BROKER_BUSY 137 Broker busy
ERR_REQUOTE 138 New prices

In my owl this line is filled in as follows


I don't understand how the software delay allows you to "fight" the requotes?

It means that DTs are delaying the order opening, and there is also a software delay.

The only way to "fight" it:

a) use a big slippage

b) use pending orders

My brokerage company has lately started to delay orders up to one minute so I cannot trade by market orders.

 
nadya:
Why not calculate the amount yourself using the OrderCommission() function ?

int n=OrdersTotal();
double Comission=0;
while (n>0)
 {
 OrderSelect(n-1,SELECT_BY_POS,MODE_TRADES);
 Comission=Comission+OrderCommission();
 n--;
 }
I'm not sure if this code calculates it correctly
 
abolk:


...

a) use a large slippage

b) use pending orders

...with market orders is simply not possible.

a) - that's the default.

b) - if market orders open, why not use them too...

 
Friends, reply to my previous message, please
 

Find average value

MathAbs(iClose(NULL,0,i)-iOpen(NULL,0,i));

Run it in the tester for n candlesticks and output it in Alert

I just can't get it to work.

Help

 
palesandr:

Find average value

MathAbs(iClose(NULL,0,i)-iOpen(NULL,0,i));

Run it in the tester for n candlesticks and output it in Alert

I just can't get it to work.

Help

Show us how it doesn't work and we'll fix it
 


extern double n = 360;


int start()
{

double v, vol;

for(int i=1;i<=n;i=i+1)
{
v=MathAbs(iClose(NULL,0,i)-iOpen(NULL,0,i));
vol=(vol+v);
}
Alert ("vol=", vol );
return;
}

 
palesandr:


extern double n = 360;


int start()
{

double v, vol;

for(int i=1;i<=n;i=i+1)
{
v=MathAbs(iClose(NULL,0,i)-iOpen(NULL,0,i));
vol=(vol+v);
}
Alert ("vol=", vol );
return;
}


vol = vol / n;
Alert ("vol=", vol );
Reason: