Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why NTMarketPosition doesn't work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Thanks for your feedback. Some users may benifit from it.

    Comment


      #17
      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


        #18
        Thanks for your suggestion. It is on our list.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          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


            #20
            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


              #21
              Atomic, thanks for the post - correct MarketPosition does represent a reserved word in ELA - however in our function supplied it would refer to the function exposed by our own DLL. I'll add this as a suggestion to change in the future to provide more clarity.

              Thanks,

              Comment


                #22
                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


                  #23
                  evanscje, I will have someone get back to you on Monday.
                  AustinNinjaTrader Customer Service

                  Comment


                    #24
                    evanscje, I guess I'm not sure I fully follow you - what issues are you having using MarketPosition in your TS code to send a buy order using NTBuyMarket as needed?

                    Comment


                      #25
                      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


                        #26
                        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


                          #27
                          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


                            #28
                            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


                              #29
                              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


                                #30
                                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 NullPointStrategies, Today, 05:17 AM
                                0 responses
                                38 views
                                0 likes
                                Last Post NullPointStrategies  
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                124 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                64 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                41 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                46 views
                                0 likes
                                Last Post TheRealMorford  
                                Working...
                                X