• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

trailing stop question

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

    trailing stop question

    Hi,

    My strategy is to open long orders upon getting the entry signal and trail stop for each open order so that the stop for each order is independently trailed.

    I am guessing we have to loop through the open orders on each incoming tick and use setstoploss to update stop for each open order.

    Could someone please help me with a pseudo code for this?

    #2
    Eklavya, please look over the reference sample titled: Separating logic to either calculate at end of bar or every tick. It places a trade and trails the trade until the position is exited.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Austin View Post
      Eklavya, please look over the reference sample titled: Separating logic to either calculate at end of bar or every tick. It places a trade and trails the trade until the position is exited.
      Austin,

      My problem is different. I have no issues in placing the order. I am able to enter long on break of an inside bar whenever that happens.

      My issue is managing the orders once entered. At any point in time I don't know how many open orders I have. But for each open order I have, I need the trail the stop for them independently.

      So How do I know how many orders are open and How to I modify the stoploss for them?

      Comment


        #4
        Eklavya, you'll need to create your own logic for keeping track of open orders. NinjaTrader doesn't come with any functions (yet) that will return to you a list of all open orders.

        My apologies for sending you that link, I thought it trailed the order but it didn't.

        Have you seen the sample for modifying the price of stop loss and profit target?
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by julifro, Today, 08:24 AM
        0 responses
        1 view
        0 likes
        Last Post julifro
        by julifro
         
        Started by GTBrooks, Yesterday, 05:53 PM
        2 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by ropofb, Yesterday, 05:45 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by Sulfred, Today, 06:07 AM
        3 responses
        12 views
        0 likes
        Last Post Sulfred
        by Sulfred
         
        Started by tff2011, Today, 06:43 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_Kate  
        Working...
        X