Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Tradestation dll strategy not working

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

    Tradestation dll strategy not working

    I added the code to send signal to Ninja from Tradestation, and I did not get a Ninja execution.

    Buy ( "MACrossLE" ) next bar at market ;
    if LastBarOnChart and NTConnected(1) then begin
    Success = NTBuyMarket("MyOrderId", 1);
    end;

    The trade does execute in Tradestation.

    #2
    Will this not work with futures because of the symbol difference between TS and Ninja?

    Comment


      #3
      Do you have the ATI interface in NinjaTrader enabled? Is the symbol mapping for your market properly setup with those instructions? - http://www.ninjatrader-support.com/H...olMapping.html
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Bertrand, how do I enable the ATI?

        Originally posted by NinjaTrader_Bertrand View Post
        Do you have the ATI interface in NinjaTrader enabled? Is the symbol mapping for your market properly setup with those instructions? - http://www.ninjatrader-support.com/H...olMapping.html

        Comment


          #5
          From the Control Center > File > Check AT Interface.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Bertrand,

            I'm getting strange results. It's firing Ninja orders when tradestation is not and when it fires the ninja order it fires both the buy and then the sell no matter what.

            I have two tradestation strategies, one for buy(or cover), one for sell(or short). The ninja code is inside of the tradestation order code so the ninja code cannot fire unless the tradestation conditions are met. It's firing orders when I refresh the chart, which it's not supposed to with LastBaronChart and it also appears to fire an order when a new bar prints. This looks like a bug to me.

            ...
            if CurrentBar > ConfirmBars and Counter = ConfirmBars then
            { CB > ConfirmBars check used to avoid spurious cross confirmation
            at CB = ConfirmBars }
            //TS code:
            Buy ( "LEStrategy" ) next bar at market ;
            //Ninja code:
            if NinjaOn then begin
            if LastBarOnChart and NTConnected(1) then begin
            NTOrderId = NTNewOrderId;
            Success = NTBuyMarket(NTOrderId, 2);
            end;
            end;


            Originally posted by NinjaTrader_Bertrand View Post
            From the Control Center > File > Check AT Interface.
            Last edited by suedeuno; 04-20-2009, 07:20 PM.

            Comment


              #7
              Hi suedeuno, let's step back for a moment - did you try the interface with our NTSample demo strategy? Does this work as expected for you?

              The strategy will for sure fire orders again when you refresh the TS chart, since you got no check for the current market position in your code and the LastBarOnChart will be set to true again as you refresh.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                I did not try the demo strategy, I just used the code from the documentation. I'll add the check for market position and see if that works.


                Originally posted by NinjaTrader_Bertrand View Post
                Hi suedeuno, let's step back for a moment - did you try the interface with our NTSample demo strategy? Does this work as expected for you?

                The strategy will for sure fire orders again when you refresh the TS chart, since you got no check for the current market position in your code and the LastBarOnChart will be set to true again as you refresh.

                Comment


                  #9
                  I assume this will work?

                  NTMarketPosition("") >= 0


                  I tried it some today and it seemed like it either was not working correctly or it was vastly lagging. What kind of lag should I expect? I'm running high bandwidth cable and a reasonably newer workstation.

                  Comment


                    #10
                    suedeuno, please post the full code that you use - the execution should be nearly instant if all is setup correctly. I can highly suggest to review and try this with the provided NTSample strategy first and then proceed from there. Thanks!
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by DayTradingDEMON, Today, 09:28 AM
                    2 responses
                    15 views
                    0 likes
                    Last Post DayTradingDEMON  
                    Started by Stanfillirenfro, Today, 07:23 AM
                    6 responses
                    22 views
                    0 likes
                    Last Post Stanfillirenfro  
                    Started by navyguy06, Today, 09:28 AM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by cmtjoancolmenero, Yesterday, 03:58 PM
                    8 responses
                    32 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by helpwanted, Today, 03:06 AM
                    2 responses
                    22 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Working...
                    X