Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Entries one signal name

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

    Multiple Entries one signal name

    I had a question.
    I currently have my strategy entering long with a single signal name. Because of this there are multiple entries with the same signal name.

    Now my question is: how do i set an indicator-based trailing stop loss for each trade? For instance I would like the trade to hit a certain profit but instead of taking a profit I want it to trigger an indicator-based trailing stop loss. Now because the take profit is at a different point for each entry the triggering of the trailing stop loss will be at different times as well.

    So, in conclusion, I'd like to have each entry use a indicator-based trailing stop loss while they use the same signal name.

    Is this possible?

    Thanks

    #2
    Welcome to our forums Cataclyst - yes that would be possible, as you could update your stoploss dynamically with your custom indicator value on each OnBarUpdate() call. For this you would use for example the price mode of SetStopLoss and call it in OnBarUpdate() to provide the trailing aspect.



    You can tie it to your entry signal name as well.

    What would be important is the reset if you're strategy is in a flat state, like shown in our reference sample here - http://www.ninjatrader.com/support/f...ead.php?t=3222
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by Cataclyst View Post
      ... So, in conclusion, I'd like to have each entry use a indicator-based trailing stop loss while they use the same signal name.

      Is this possible?

      Thanks
      They are different signals. Why must they have the same name? What is critical in the logic that requires the signals to have the same name? Why not simply use separate names for separate signals, so that they are entirely devoid of interaction with each other, in any manner?

      Comment


        #4
        Originally posted by koganam View Post
        They are different signals. Why must they have the same name? What is critical in the logic that requires the signals to have the same name? Why not simply use separate names for separate signals, so that they are entirely devoid of interaction with each other, in any manner?
        My logic enters a trade whenever the settings are fulfilled. As far as I know i'm only able to set the signal name once as I'm only using one if statement to execute the trade.

        For instance,

        if(somevalue > 1)
        EnterLong(1,"Long");

        every trade executed using this if statement is confined to the signal name of "Long". If there's a better way to do it I'm all ears.

        Comment


          #5
          Originally posted by Cataclyst View Post
          My logic enters a trade whenever the settings are fulfilled. As far as I know i'm only able to set the signal name once as I'm only using one if statement to execute the trade.

          For instance,

          if(somevalue > 1)
          EnterLong(1,"Long");

          every trade executed using this if statement is confined to the signal name of "Long". If there's a better way to do it I'm all ears.
          You mean that you are using the exact same signal logic to enter multiple positions, both initial entry and addons? In that case you probably need to use IOrders for your entries. You check for the existence of the first IOrder, then make the second entry with a new IOrder, and so on.

          //declare your IOrders
          Code:
          private IOrder entryOrder1 = null;
          private IOrder entryOrder2 = null;
          private IOrder entryOrder3 = null;
          //etc
          //use them.
          Code:
          if(somevalue > 1)
          {
          if (entryOrder1 == null) entryOrder1 = EnterLong(entry1ParamList[]);
          else if (entryOrder2 == null) entryOrder2 = EnterLong(entry2ParamList[]);
          else if (entryOrder3 == null) entryOrder3 = EnterLong(entry3ParamList[]);
          //etc
          }
          Needless to say, you can turn those if statements into code blocks, and add other tracking logic.

          Remember to nullify all entry orders when the position goes flat, so that you can start over with entries.
          Last edited by koganam; 10-05-2012, 11:46 AM.

          Comment


            #6
            That's awesome. Thanks koganam!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by MacDad, 02-25-2024, 11:48 PM
            8 responses
            173 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by alancurry, Today, 06:53 AM
            0 responses
            6 views
            0 likes
            Last Post alancurry  
            Started by Juanhuisman, Today, 06:51 AM
            0 responses
            6 views
            0 likes
            Last Post Juanhuisman  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            173 responses
            2,340 views
            0 likes
            Last Post intelligenttrader  
            Started by ArkansasClint, 04-25-2024, 09:28 AM
            1 response
            25 views
            0 likes
            Last Post Leafcutter  
            Working...
            X