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 Christopher_R, Today, 12:29 AM
        0 responses
        6 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,235 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        3 views
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        7 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,415 views
        0 likes
        Last Post Traderontheroad  
        Working...
        X