Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

unique entry

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

    unique entry

    In addition to UniqueEntries is there some sort of Unique Exit command for Stops/Trails?

    #2
    Hello zachj,

    Thank you for your post.

    To exit uniquely with SetStopLoss() and SetTrailStop() you will need to call the signalName of the entry you wish to exit.

    The syntax for SetStopLoss() is the following: SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool simulated)

    And for SetTrailStop() it is the following: SetTrailStop(string fromEntrySignal, CalculationMode mode, double value, bool simulated)

    For information on the different order methods please visit the following link: http://www.ninjatrader.com/support/h...er_methods.htm

    Please let me know if you have any questions.

    Comment


      #3
      So if I have..
      if //conditions here//
      {EnterLong(200, "SPY");}

      Would I have...
      if //conditions here//
      {SetStopLoss("SPY", CalculationMode.Ticks, 1);}

      because I'm getting an error message, tried SPY w/o parantheses too. I do have a for loop at the start of the Entry and StopLoss not sure if that throws it off.

      For loop is.... for (int series = 0; series < 3; series++)
      Last edited by zachj; 06-30-2013, 07:13 PM.

      Comment


        #4
        Hello zachj,

        Thank you for your response.

        What is the error message you are receiving? Please detail the full message in your response.

        Comment


          #5
          No overload for method 'SetStopLoss' takes '3' arguments

          Comment


            #6
            Hello zachj,

            Thank you for your response.

            The syntax when using the signalNames will need to be the following: SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool simulated)

            So you could do the following: SetStopLoss("SPY", CalculationMode.Ticks, 1, false);

            Comment


              #7
              Ok gotcha.

              If I wanted to do multiple instruments is this the best way to do it or is there a shorter way, if this even would work that is....
              SetStopLoss("SPY", CalculationMode.Ticks, 1, false);
              SetStopLoss("DIA", CalculationMode.Ticks, 1, false);

              I have the EnterLong based on a loop where it keeps pulling through one series at a time...
              for (int series = 0; series < 3; series++)
              //entry conditions
              {EnterLong();}

              Comment


                #8
                Hello zachj,

                Thank you for your response.

                The string fromEntrySignal in the Set() methods needs to match the string signalName form the Enter() methods. This means your loop will likely not support the unique signal names in this regard.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by burtoninlondon, Today, 12:38 AM
                0 responses
                5 views
                0 likes
                Last Post burtoninlondon  
                Started by AaronKoRn, Yesterday, 09:49 PM
                0 responses
                13 views
                0 likes
                Last Post AaronKoRn  
                Started by carnitron, Yesterday, 08:42 PM
                0 responses
                11 views
                0 likes
                Last Post carnitron  
                Started by strategist007, Yesterday, 07:51 PM
                0 responses
                13 views
                0 likes
                Last Post strategist007  
                Started by StockTrader88, 03-06-2021, 08:58 AM
                44 responses
                3,982 views
                3 likes
                Last Post jhudas88  
                Working...
                X