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 cmtjoancolmenero, Yesterday, 03:58 PM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by benmarkal, Yesterday, 12:52 PM
        3 responses
        23 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by helpwanted, Today, 03:06 AM
        1 response
        20 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        11 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        244 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Working...
        X