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 bortz, 11-06-2023, 08:04 AM
        47 responses
        1,606 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        13 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X