Profile Picture

NewBar, limit order expiration

Posted By rick123 7 Years Ago
Message
Posted Monday September 20 2010
billb, young, dplaisted and pch,

I just started using RightEdge this weekend, and I like it.

However, I do have a few questions for you.

1. about the NewBar() function.
NewBar() function is being called at the begin of a bar or at the end of a bar?
My understand is it is called when the bar is totally completed. Let's say I'm using 5 min bars. if the bar time is 10:00:00-10:05:00, it will be called at 10:05:00. right?
If I place an order in the NewBar() function, it will be targeted for next bar, right?

I saw in some post mentioning that indicators are calculated only per bar. not per tick. Is there any way to calculate a value per tick for an incompleted bar?


2. about limit order expiration
I read it somewhere saying that limit order will expire after one bar if it's not filled.
let's say I placed a limit order in the NewBar() function for the bar of 10:00:00-10:05:00, so I assume it will be executed in the bar of 10:05:00-10:10:00, and if it's not filled,
it will be cancelled at the begining of the bar of 10:10:00-10:15:00, right?


Thanks.

Posted Monday September 20 2010
rick123 (9/20/2010)
billb, young, dplaisted and pch,

I just started using RightEdge this weekend, and I like it.

However, I do have a few questions for you.

1. about the NewBar() function.
NewBar() function is being called at the begin of a bar or at the end of a bar?
My understand is it is called when the bar is totally completed. Let's say I'm using 5 min bars. if the bar time is 10:00:00-10:05:00, it will be called at 10:05:00. right?
If I place an order in the NewBar() function, it will be targeted for next bar, right?

Correct.

I saw in some post mentioning that indicators are calculated only per bar. not per tick. Is there any way to calculate a value per tick for an incompleted bar?

There's not any way to use the built-in indicators to calculate based on ticks. You can write the code to do the calculations yourself, but of course that is more work.

2. about limit order expiration
I read it somewhere saying that limit order will expire after one bar if it's not filled.
let's say I placed a limit order in the NewBar() function for the bar of 10:00:00-10:05:00, so I assume it will be executed in the bar of 10:05:00-10:10:00, and if it's not filled,
it will be cancelled at the begining of the bar of 10:10:00-10:15:00, right?


This is correct for limit orders which are used to open a position. When you set a profit target for a position, a limit order is sent, which does not expire until you change the profit target or the position is closed.

Thanks,
Daniel
Posted Tuesday September 21 2010
Thanks for the reply, dplaisted.

Is there any way to do things onBarOpen?



dplaisted (9/20/2010)
rick123 (9/20/2010)
billb, young, dplaisted and pch,

I just started using RightEdge this weekend, and I like it.

However, I do have a few questions for you.

1. about the NewBar() function.
NewBar() function is being called at the begin of a bar or at the end of a bar?
My understand is it is called when the bar is totally completed. Let's say I'm using 5 min bars. if the bar time is 10:00:00-10:05:00, it will be called at 10:05:00. right?
If I place an order in the NewBar() function, it will be targeted for next bar, right?

Correct.

I saw in some post mentioning that indicators are calculated only per bar. not per tick. Is there any way to calculate a value per tick for an incompleted bar?

There's not any way to use the built-in indicators to calculate based on ticks. You can write the code to do the calculations yourself, but of course that is more work.

2. about limit order expiration
I read it somewhere saying that limit order will expire after one bar if it's not filled.
let's say I placed a limit order in the NewBar() function for the bar of 10:00:00-10:05:00, so I assume it will be executed in the bar of 10:05:00-10:10:00, and if it's not filled,
it will be cancelled at the begining of the bar of 10:10:00-10:15:00, right?


This is correct for limit orders which are used to open a position. When you set a profit target for a position, a limit order is sent, which does not expire until you change the profit target or the position is closed.

Thanks,
Daniel
Posted Wednesday September 22 2010
To respond to the bar open, you would need to look for the first tick in a bar in the NewTick method.

Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems