When does marketposition change?

skan

Junior member
Messages
20
Likes
0
Hi

Let's say we are running a strategy on hourly bars.
At the end of each bar we know the Low, High, Open and Close of that bar.
With that information we can make calculation and send orders at the end of the bar.
Therefore you have one bar delay betwen the data reception and the orders sending.

but When do we know marketposition value?
What happens when a stop is executed in the market within a bar?
Do I know it at once or at at the end of the bar?



In some forum I've seen
this expression:

"If marketposition = 1 and barssinceentry = 0 then Buy ... "

I can't understand the meaning of than sentence.
How can it be possible to be in marketposition = 1 if barssinceentry is 0,
Shouldn't barsinceentry be at least one?
 
End of any bar is the Close of that bar. The 1200 5-minute bar ends (closes) at 5 minutes past 12. The next 5-minute bar starts at 1205 and ends (closes) at 1210. The daily bar ends when the market closes: the next daily bar opens when that market re-opens, which could be several hours later, dependent on the type of chart you are looking at.

I don't know why you need to understand the sentence about bars equalling 0. This implies that you are still within the same bar, e'g. it is only 1203 or 1204. Does this help?
 
That's the matter, if you are still within the same bar you don't get information on what is going on on the market (or any marketposition change) till you end that bar, Isn't it?
Thus, if you know that marketposition=1 is because that marketpostion change took place at least one bar ago.
 
That's the matter, if you are still within the same bar you don't get information on what is going on on the market (or any marketposition change) till you end that bar, Isn't it?
Thus, if you know that marketposition=1 is because that marketpostion change took place at least one bar ago.


I'm not familiar with this 'marketposition=1' requirement. Don't know how to advise. Suspect this comes from a mechanical strategy that requires a delay on a given signal before entry, so that the time delay allows a confirmtaion pattern to emerge: clearly if you think price is moving up, waiting another 5 minutes will confirm you are right (if it has gone up): but if you enter now, you are paying a higher price than you would have 5 minutes ago. C'est la vie.

Perhaps you can go right back to basics - What are you trying to do? If you do come to understand this marketposition=1 requirement, will it help you either make more money or avoid losses?
 
Hello again.

I can make different tihings in order to solve the issues I told before, I just wanted to know your opinions on the way that platforms do work and understand some sourcecodes I've seen.

Let me put another example of something odd that can happen.

Working in 1 hour bars and being in marketposition=0 at the beggining of a bar I perform some calculations and I decide to send a Buy order.
That order on Tradestation can't be sent before the end of that bar, then I send it at Close.

The idea is that at close my order will be sent to the market.
But what happens if during the bar, before the close is reached, a previous stop (buy) is fulfilled in the market and changes my position?
I would have to orders instead of one and I think my strategy won't know it It will think I'm still out of the market when I send the second order, Isn't it?
 
Top