Announcement

Collapse
No announcement yet.

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

      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.

          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.

              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!

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    566 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    330 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    101 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    547 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    548 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X