We are simply checking a position before we make an entry. I was replying to @pstrusi, (the immediate querier) so maybe we are talking at cross purposes?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OnPositionUpdate - MarketPosition parameter - what's it good for?
Collapse
X
-
Originally posted by sledge View Post
We are simply checking a position before we make an entry. I was replying to @pstrusi, (the immediate querier) so maybe we are talking at cross purposes?
-
Originally posted by pstrusi View PostThanks Koganam, the problem is that you presume that I'm exiting when actually I'm reversing positions. I'm sorry NOT to clear that before
Regardless, just as you would do if you were manually clicking the mouse, you decide that you are going to make a kind of entry order, so you check your position, then make the necessary order. You check your position immediately before you make the order, no matter how many times you have checked the position, or not, in the past.
It is very simple. Before you put your money it risk, the last thing that you do is check your position, so as to be sure that you are not making a mistake by entering the order that you are about to make. There is nothing to argue about. Whether the computer makes the entry or you click the mouse, the entry decision process is exactly the same
Comment
-
Koganam, I'm not trying to trade as HFT with my algo, still some signals might trigger within a timeframe where actually an old order was just submit, still working...etc So before the new order is submit, in order to avoid overfillings or unwilling positions, I HAVE to check what is my instance position, I don't think that this simple request is something complicated to NT, or at least it shouldn't be.
Thanks for your willing to help always
Comment
-
Originally posted by pstrusi View PostKoganam, I'm not trying to trade as HFT with my algo, still some signals might trigger within a timeframe where actually an old order was just submit, still working...etc So before the new order is submit, in order to avoid overfillings or unwilling positions, I HAVE to check what is my instance position, I don't think that this simple request is something complicated to NT, or at least it shouldn't be.
Thanks for your willing to help always
Well, if you will not take the simple solution, I guess I will leave to to find the complicated solution that you are seeking. Yes, it is a simple request, and no, it is not complicated. You are the one who wants to make it complicated. You have been given a simple, reliable solution that I use myself personally, and you persist in looking for some other answer.
All the best to you. I am out.
Comment
-
I just want to do what you say: check my position before send a new order. I know how to do that, it could be done in OnBarUpdate, OnPositionUpdate...etc The reason for my request is because there's a doubt coming from OnPositionUpdate indicated by Sledge and still confirmed by NT support team here, that 's a difference depending in how you call it. So that's what I want to address. Let's wait for NT support team answer to contrast. Thanks
Comment
-
Hello pstrusi,
Thank you for your response.
Why not just use OnPositionUpdate() when position returns Flat? I may not be understanding your reason for avoiding this?
The "actual" position or more accurately the position reported by the brokerage technology is marketPosition. The order of events as they are processed would be called through position.MarketPosition instead.
Comment
-
Originally posted by NinjaTrader_PatrickH View PostHello pstrusi,
Thank you for your response.
Why not just use OnPositionUpdate() when position returns Flat? I may not be understanding your reason for avoiding this?
The "actual" position or more accurately the position reported by the brokerage technology is marketPosition. The order of events as they are processed would be called through position.MarketPosition instead.
So, having in mind what you say, then This following snippet would do the job?
Code:protected override void OnPositionUpdate(IPosition position) { if ( position.MarketPosition == MarketPosition.Long ) { cp=1.0; } if ( position.MarketPosition == MarketPosition.Short ) { cp=-1.0; } } // Then before submitting any new order, would it good enough to check the value of CP, right?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by inanazsocial, Today, 01:15 AM
|
0 responses
2 views
0 likes
|
Last Post
by inanazsocial
Today, 01:15 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
22 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by Davidtowleii, Today, 12:15 AM
|
0 responses
3 views
0 likes
|
Last Post
by Davidtowleii
Today, 12:15 AM
|
||
Started by guillembm, Yesterday, 11:25 AM
|
2 responses
9 views
0 likes
|
Last Post
by guillembm
Yesterday, 11:58 PM
|
||
Started by junkone, 04-21-2024, 07:17 AM
|
9 responses
70 views
0 likes
|
Last Post
by jeronymite
Yesterday, 11:51 PM
|
Comment