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

Set trailstop to 0?

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

    #16
    imported post

    Its assigned in an Enter() method. Its the optional signal name you provide. Below is how you assign in an Enter() method and then reference it from an exit method.

    EnterLong(string signalName)

    ExitLong(string fromEntrySignal)

    Ray
    RayNinjaTrader Customer Service

    Comment


      #17
      imported post

      Ok, I don't mean to be a hassle, but I am "hung up"on this one. Indulge me...

      The syntax for entering...

      1. EnterLongLimit(double limitPrice)
      2. EnterLongLimit(double limitPrice, string signalName)

      3. EnterLongLimit(int quantity, double limitPrice)

      4. EnterLongLimit(int quantity, double limitPrice,string signalName)


      The syntax for exiting...

      1. ExitLongLimit(double limitPrice)

      2. ExitLongLimit(int quantity,double limitPrice)
      3. ExitLongLimit(double limitPrice,string fromEntrySignal)

      4. ExitLongLimit(double limitPrice,string signalName,string fromEntrySignal)

      5. ExitLongLimit(int quantity,double limitPrice, string signalName,string fromEntrySignal)



      Where my mis-understanding lies is in the signalName vs fromEntrySignal. What you're telling me is they are *the same thing*? Then that would render the "Exit" syntax's 4 and 5(if you will) moot. Or, if I *am* missing something, then I ask you, how do you set the "fromEntrySignal" when it is *outside* the EnterLongLimit() method?

      I see NO syntax like this -> EnterLongLimit(int quantity,double limitPrice, string signalName,string fromEntrySignal)

      Comment


        #18
        imported post

        Hi funk101,

        Please read this.

        http://www.ninjatrader-support.com/H...verview36.html

        I am hoping that my documentation on this subject is clear.

        Ray

        RayNinjaTrader Customer Service

        Comment


          #19
          imported post

          For me it's not clear. Never said I was a genius. I don't see in your documentation this syntax...:

          EnterLongLimit(int quantity,double limitPrice, string signalName,string fromEntrySignal)


          Understand? So, if I enter a trade like this:

          string signalName = "mySignalName";

          EnterLongLimit(numContracts, Close[
          0], signalName);

          ...and I want to exita trade like this:

          ExitLongLimit(numContracts, Close[0], signalName, fromEntrySignal);

          Where was "fromEntrySignal" defined? Because, as I can tell, "signalName" is my identifier to the trade. Are you telling me this...?



          enter...:

          string mySignalName = "yadayada";

          EnterLongLimit(numContracts, Close[
          0], mySignalName);



          exit...:

          string myFromEntrySignal = "blahblah";

          ExitLongLimit(numContracts, Close[0], mySignalName, myFromEntrySignal);

          if *just* defined before exiting, well, then I don't understand, and I'll have to read over again to get it to sink in. What I see is signalName AND fromEntrySignal are trying to accomplish the same thing, to be an identifier to a trade.

          Comment


            #20
            Hi funk101,
            I am not with support staff. just another user. I am not sure if your issue was ever resolved satisfactorily. I thought I might have answer you are looking for.
            so..
            Let's say you have a custom strategy and multiple entry and exit conditions.
            let's name them entry1, entry2 and exit1, exit2.

            entry1 = EMA crossup
            entry2 = MACD >0

            exit1 = EMA crossdown
            exit2 = MACD<0

            Now, if first condition is met, your fromEntrySignal = "entry1" and signalName= "order1" for following entry :

            EnterLongLimit(int quantity,double limitPrice, string signalName,string fromEntrySignal)

            The reasoning behid this IMO is, fromEntrySignal tells you why you entered the trade and signalName is a way to name this particular order. If say, MACD>0 after sometime, you have
            fromEntrySignal = "entry2" and signalName= "order2"

            Now, while exiting positions, your fromEntrySignal is "exit1/2", which specifies why you are exiting and signalname is again the name for this particular exit. So when you look at the chart after closing positions, you know when, which orders were entered/exited and why so.

            ExitLongLimit(numContracts, Close[0], SignalName, FromEntrySignal);

            Again, my opinion is not "official". This is the way I thought it works.
            hope it helps.
            K

            Comment


              #21
              K,

              This is close to accurate.

              One correction, there is no "fromEntrySignal" parameter for the method EnterLongLimit().

              Its EnterLongLimit(int quantity, double limitPrice, string signalName). Only Exit() methods have a parameter "fromEntrySignal".

              In a nutshell, Enter() methods take an optional parameter to "name" the order/signal. Exit() methods have an optional parameter that allow you to tie the exit method to a specific entry.
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,610 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              9 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              19 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              6 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              16 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X