Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulating TS entry / exits

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

    Simulating TS entry / exits

    Ninjatrader.

    Thanks for the reply. I don't always intend to use targets as exits. I have different indicators / criteria to exit based on market conditions. Can I just send an "EXIT" order for a certain quantity of the position?

    Thanks, Anthony

    //PREVIOUS PM

    Anthony,

    I would advise you to use the NT DLL interface for TradeStation. There are fuctions available for order placement such as NTSellLimit() that I would use for submitting the target orders. I would first of course submit your entry order, NTBuyMarket(), then once filled, check NTOrderStatus() or check for position NTMarketPosition(), then submit the targets. This is all documented here -

    http://www.ninjatrader-support.com/H...Functions.html

    Please send follow up notes through the forum as I rarely check my forum mail.

    Thanks.

    Hey ninjatrader.

    I'm interested in using NT5 to automate TS signals to my MB broker. In TS I currently have strategies which will simulate entrances and exits of multiple lots. For example, I have an entrance of 15 lots, and then I usually have 3 profit targets where I close out 5 lots each time a target is reached. Basically where I'm going with this is I understand how I have to enter the order through my EL code, but for exits I'm a little confused. I checked the documentation a few times and the forum with no luck.

    Basically, my intentions are to have TS send the order entry, then send the exit orders (pyramiding out of the order, or all in one shot). All of the entrances / exit signals are computed 100% at TS, I simply need to send them to NT for procesing.

    To make things easier on you in terms of explaining, I am a software engineer so I shouldn't have trouble understanding.

    Thanks again for you help. I hope my explination is understandable, as I'm rushing this out at work.

    Anthony


    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    #2
    imported post

    Absolutely, just use any of the available functions from the DLL interface. Alternatively, if your TS strategy is already set up to enter and exit using native EL code, just use our mail based interface.
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      ninja.

      I've been looking through the function list and I don't see anything which explicitly talks of exits. I'm assuming that I would have to use NTCommand with the CLOSEPOSITION command, but the chart for appliciable fields has nothing for quantity. Can you give me the line of code I would use for this?

      Thanks, Anthony
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        imported post

        Exit is relative.

        Example purposes only:

        variables: Success(0);

        if Close > Open then
        Success = NTBuyMarket("orderIdString", 1);

        if NTMarketPosition("") > 0 then
        Success = NTSellMarket("OrderIdString", 1); <----- Your exit order
        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          Ok, so let me get this straight...

          //ENTER LONG

          Success = NTBuyMarket("orderId", quantity);

          //EXIT LONG

          sucess = NTSellMarket("orderId", quantity);

          //ENTER SHORT

          sucess = NTSellMarket("orderId", quantity);

          //EXIT SHORT

          Success = NTBuyMarket("orderId", quantity);



          Is that right? You just try to enter the opposite way?

          TS has things like, buy, sell, buy to cover, etc...

          Thanks.
          mrlogik
          NinjaTrader Ecosystem Vendor - Purelogik Trading

          Comment


            #6
            imported post

            That is correct.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by gravdigaz6, Today, 11:40 PM
            0 responses
            4 views
            0 likes
            Last Post gravdigaz6  
            Started by MarianApalaghiei, Today, 10:49 PM
            3 responses
            9 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by XXtrader, Today, 11:30 PM
            0 responses
            3 views
            0 likes
            Last Post XXtrader  
            Started by love2code2trade, Yesterday, 01:45 PM
            4 responses
            28 views
            0 likes
            Last Post love2code2trade  
            Started by funk10101, Today, 09:43 PM
            0 responses
            9 views
            0 likes
            Last Post funk10101  
            Working...
            X