OrderPeriod

 

Hi to all,

In order to close orders in the same peiod I need a command like OrderSymbol OrderPeriod, ant idea ?

thanks

 

You'll need to explain yourself a bit more clearly.

You wish to close:

- All orders opened by a certain EA instance?

- All orders opened by any instance of a certain EA?

- All orders associated with a certain symbol, by a particular EA or regardless of EA?

- All orders associated with a certain period, by a particular EA or regardless of EA?


CB

 

Sorry, you are right .

for each open chart there is a EA,but when I need to close order for any currency with is period, the expert close all period in this currency - I want to close only a specific perod

Yossibr

 

Okay.

In your order close loop (make it decrement rather than increment by the way):

- After OrderSelect()

- Check for OrderPeriod() in addition to OrderSymbol() - these will tell you the currency and period of the specific order you have selected, so you can choose which to then close


CB

 
cloudbreaker wrote >>

Okay.

In your order close loop (make it decrement rather than increment by the way):

- After OrderSelect()

- Check for OrderPeriod() in addition to OrderSymbol() - these will tell you the currency and period of the specific order you have selected, so you can choose which to then close

CB

There is no OrderPeriod() command

 
yossibr:

There is no OrderPeriod() command

You can use OrderComment() to specify on what timeframe the trade was opened.

Then when closing orders you can check the comment and do your actions...

 
robofx.org wrote >>

You can use OrderComment() to specify on what timeframe the trade was opened.

Then when closing orders you can check the comment and do your actions...

thanks,

I already do it, when I open a new order I write the period . and I want to close I skin the period from the comment .

Thank you CB !!!!!

 

Ha ha - you had me convinced about OrderPeriod() due to your first post.

Just use the comment field or magic number to uniquely ID the orders to an EA instance.


CB

 
cloudbreaker wrote >>

Ha ha - you had me convinced about OrderPeriod() due to your first post.

Just use the comment field or magic number to uniquely ID the orders to an EA instance.

CB

Thanks CA .

if I had 30 open orders, the magic number can help ?

Please explain .

Yossibr

 

There's no magic. The idea is to decide upon an identity number that can be used by an EA when opening orders, then using it to identify what orders "belong" to which EA.

I just use it when there are no other methods of deciding which EA opened which orders. For example, its unnecessary if you've only got one EA per symbol in each account.


CB

 
cloudbreaker wrote >>

There's no magic. The idea is to decide upon an identity number that can be used by an EA when opening orders, then using it to identify what orders "belong" to which EA.

I just use it when there are no other methods of deciding which EA opened which orders. For example, its unnecessary if you've only got one EA per symbol in each account.

CB

Thank you .

Reason: