Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tradestation Interface to Ninjatrader example

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

    Tradestation Interface to Ninjatrader example

    Hi,

    I am trying to get a simple example working in easy language that will fire 1 order off through the ATI, and not send any more orders until that position is flat and there are no positions. Would anyone have a example I could look at which is written for easy language? Any help would be greatly appreciated.

    Thanks



    #2
    imported post

    Did you look at the sample script provided with NT installation? See Help Guide.
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Hi,

      Yes I did try the small example provided. What I found was the example sent many orders which varied from 1 to 5 before the first order could get filled. Is there a way to tell the ATI to only send one order and a stop if it has another order pending ?



      Here is a sample of what I tried



      NotInTrade
      =NTMarketPosition("MyAcctId");

      ifLastBarOnChartandNTConnected(1)and(NotInTrade=0)then



      begin





      Success=NTBuyMarket("",1); // Send Market Order

      NotInTrade = 1; // Set Flag Immediately To Indicate I Sent An Order

      Success=NTSellStop("",1,InsideBid-.0010); // Send Stop

      end;

      Comment


        #4
        imported post

        How about createa variable? I am no EL expert but in plain english:

        var placed = false;

        if (placed == false)
        placeOrder


        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          Well in the code snippet I showed earlier I have a variable called NotInTrade that is suppose to reflect the current position state. If I get a order filled it was my assumption that NotInTrade = NTMarketPosition("MyAcctId") would not return 0

          This should stop theIF statement which checks for NotInTrade = 0from sending any more trades. I even went to the trouble of setting the flag just after I send a market order to a 1 which would stop the loop from firing again. I still see more than one trade from being sent and it also sends more orders on the next trigger condition even if I currently have some orders filled. Am I missing something here on how NTMarketPosition works ?


          Comment


            #6
            imported post

            Widgetman,

            My apologies. I just tested the script and experience the same results as you. I will forward to development for further investigation. NTMarketPosition() should return a value other than zero if not flat. We will have this resolved with our next update.

            Ray
            RayNinjaTrader Customer Service

            Comment


              #7
              imported post

              Hi Ray,
              Thanks for all the help. I really would like to use your system to interface my custom trading system. Any ideas as to how long it would take to get fixed ? I also am a Engineer so if there is anything i can do to help with the testing process please let me know.
              -Thanks

              Comment


                #8
                imported post

                Thanks for the offer. Should be fairly straightforward to resolve. Likely have another update within a week.

                Ray
                RayNinjaTrader Customer Service

                Comment


                  #9
                  imported post

                  Widgetman,

                  The problems I experienced were due to changes I personally made to the NTMarketPosition() function some time ago for testing purposes. The function works as expected.

                  Please reimport and override all NT functions. Import the ELD from C:\Program Files\NinjaTrader 5\bin\AutoTrade\NINJATRADER.ELD.

                  This will ensure that you have the correct functions. Then try the NT sample script again.

                  Ray
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    imported post

                    Hi Ray,
                    I downloaded the latest beta version off of your site last Thursday and re-installed it. I also have imported the latest ELD that was installed after running the beta. It is dated 12/21/2005. Is the the correct file I need to test ?

                    Comment


                      #11
                      imported post

                      Hi Ray,
                      I also wanted to ask if there was a way to get a print statement in the easy language interface to show what the NTMarketPosition() value currently was so I could trace through the sequence, and see if I can actually see the value change from 0. Please let me know when you get a chance.
                      -Thanks

                      Comment


                        #12
                        imported post

                        Sure, just add Print(NTMarketPosition("")); at thetop of the NTSample script.
                        RayNinjaTrader Customer Service

                        Comment


                          #13
                          imported post

                          Hi,
                          What is the date on the ELD file you have working ? I would like to make sure I am using the same one.
                          -Thanks

                          Comment


                            #14
                            imported post

                            March 25th, 2006
                            RayNinjaTrader Customer Service

                            Comment


                              #15
                              imported post

                              Hi Ray,

                              Can you tell me where I can get a copy of the newer version of the ELD. I just installed the beta version once again, and the ELD file in the bin folder/autotrade is dated 12/21/2005. Maybe you can post a link here to DL it. Thanks for all the help.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ScottWalsh, Today, 04:52 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by ScottWalsh, Today, 04:29 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by rtwave, 04-12-2024, 09:30 AM
                              2 responses
                              22 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by tsantospinto, 04-12-2024, 07:04 PM
                              5 responses
                              70 views
                              0 likes
                              Last Post tsantospinto  
                              Started by cre8able, Today, 03:20 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X