Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Why NTMarketPosition doesn't work?
Collapse
X
-
Here it is 2 1/2 years later and the problem with NTMarketPosition when using daily continuous TradeStation symbols with ".D" (ie: @ESU10.D) still exists. Instead of using the workaround posted by aslane in 2008, I would suggest that a fix be made on the NT end. This is the first problem I came accross on my first NT strategy and it took a while to figure out..Last edited by RuleTrader; 06-25-2010, 02:08 PM.
Comment
-
Problem still there
Here it is, April of 2011, and this problem is still there. I am implementing the function modification suggested below, so I hope that does it. Before I found this thread my workaround was to use @ESxxx rather than @ESxxx.D. I just had to create a custom session which put me approximately where I wanted to be.
Comment
-
Use of marketposition in function
Marketposition is an EasyLanguage reserved word and function name for returning a TradeStation strategy marketposition.
This is the NinjaTrader function which defines marketposition as something else.
DefineDLLFunc: "NtDirect.dll", int, "MarketPosition", lpstr, lpstr;
inputs: Account(string);
NTMarketPosition = MarketPosition(GSN, Account);
How can we have two functions both using the same word?
Comment
-
So then what?
How then do you mirror standard EL test : If Marketposition<>1 then begin"
NTBuyStop() or NTBuyMarket() .. I have all kinds of symbols - some with .d some without.
I just want to send orders to NT that match the TS/EL orders. Is this not possible?
Comment
-
Remaining issues
It comes down to two questions:
1) Does the function NTMarketposition successfully read in the built in EL function Marketposition rather than look to NT to see if a position exists?
2) Can the stop level include tomorrow's open ... such as "open next bar + N (pts)". (This kind of order is acceptable in EL.)
Comment
-
evanscje, NTMarketPosition is not concerned with any TS strategy market position, it checks the market position for the account / instrument combination at NT.
The next bar's open can't unfortunately be known in advance at the time of order submission, you would need to printlog the price TS would attempt to send it at and then see if that matches what you need in realtime use.
Comment
-
NTMarketposition
I want to send orders from TS through NT to TT. If I read the dox right NT has no idea what my residual position is at TT so the NTMarketpostion function has no meaningful value. (I don't really know where it gets its default values from)
Is that right?
TS understands the value of "open next bar" which is why it is able to send orders using it as an input. Are you saying that those values are nullified when they are passed to NT?
How would I usea printlog to extract the value and then put it into the order?
Comment
-
evanscje, NT would the TT account position from it's own tracking, so provided you did not hold positions overnight - the NTMarketPosition check should work for checking your NT / TT account position from TS.
You would use the Print command in your TS code to see exactly which stop order price value you could calculate in your TS strategy at the needed point in time, you could send this as order to NT using our ELA functions.
Comment
-
EOD System using Open Next Bar (ONB) orders
Any end of day system where orders are fed to TT would then fail since NT would lose its knowledge of the position every night. One could build a new variable to match Marketposition that would replace NTmarketposition.(which is what I'll try)..
...which leaves me with my open next bar reference...
I am very familiar with EL but have never used or needed to use a printlog to check for the TS calc of open next bar. That internal function grabs the open but still uses all variable references from the previous day's close (all EOD charts). Do you want EL to say ask for a value for the open by saying:
If time> opening time then ONB= open
- but that would require the settings to all change to Look Inside the Bar which means all the eod variables change. Is that what you mean or is there some method that other people have used to get NT to execute EL based Open Next Bar orders?
Comment
-
That's correct - there is unfortunately a limitation for overnight positions held with TT.
I would not be aware of reports from customers using orders with the open of next bar price info TS would internally make available at time of order submission in their system (since at the time you send the order the info is not known unless you're working in realtime with intrabar updates on, then you could send the order a tick after the open is known).
Which is why I would suggest printing the value you have avialable at the time you wish to submit the order, thus you can check if the price is what you expect / hope it to be.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
109 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
37 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
39 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
77 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment