right place to put RefreshRates()

 

Hi all,

I've seen some code examples where the RefreshRates() followed by Sleep() is after, say OrderClose().

The question is where should be the right place to put it. Shouldn't it be before OrderSend(), OrderClose() or OrderModify(), instead of after ?

Thanks in advance for any clarification.

Luis 

 
RR needs to be placed after long delays (sleep and server calls) before the next server call (and calculations using the predefined variables) in time. Easiest is after the sleep. Never followed by sleep.
 
luisneves:

Hi all,

I've seen some code examples where the RefreshRates() followed by Sleep() is after, say OrderClose().

The question is where should be the right place to put it. Shouldn't it be before OrderSend(), OrderClose() or OrderModify(), instead of after ?

Was it actually needed ?   it's very easy to find bad code . . .
Reason: