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

naming signal name

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

    naming signal name

    Suppose I have two variations of a strategy as follows:

    if (CrossAbove(E1[0]*1.001, E2[0]))
    EnterLong("MA CrossOver");
    if (CrossBelow(E1[0]*0.999, E2[0]))
    EnterShort("MA CrossOver");

    versus

    if (CrossAbove(E1[0]*1.001, E2[0]))
    EnterLong("MA CrossOver Long");
    if (CrossBelow(E1[0]*0.999, E2[0]))
    EnterShort("MA CrossOver Short");


    The difference is only the names of the signals.

    Is there a difference in the behavior between the two? In the second case, where the names are different, will the EnterShort() close out the previous EnterLong() positions and vice versa?

    #2
    Hello,

    Thank you for the question.

    Not in this case, in NinjaTrader when using the Managed Approach, if you submit an order in the Opposite direction, it would reverse your current position. The Signal name would only come into play when using Stops or Targets or where you see "FromEntrySignal" listed.

    The best way to see what the end result is between these two lines of code would be to execute the code and then note the differences.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      Thank you for the question.

      Not in this case, in NinjaTrader when using the Managed Approach, if you submit an order in the Opposite direction, it would reverse your current position. The Signal name would only come into play when using Stops or Targets or where you see "FromEntrySignal" listed.

      The best way to see what the end result is between these two lines of code would be to execute the code and then note the differences.

      I look forward to being of further assistance.
      Thanks, Jesse.

      I had another question. What if I have implemented two moving average crossovers with


      EntriesPerDirection = 1;
      EntryHanding = EntryHandling.UniqueEntries;



      Such as like this:


      if (CrossAbove(E1[0]*1.001, E2[0]))
      EnterLong("Slow MA CrossOver");
      if (CrossAbove(E3[0]*1.001, E4[0]))
      EnterLong("Fast MA CrossOver");

      if (CrossBelow(E1[0]*0.999, E2[0]))
      EnterShort("Slow MA CrossOver");
      if (CrossBelow(E3[0]*0.999, E4[0]))
      EnterShort("Fast MA CrossOver");

      In this case, suppose there are two live LONG contracts one triggered by "Slow MA CrossOver" and another by "Fast MA CrossOver". Then suppose a SHORT "Slow MA CrossOver" gets triggered - would this close both the previous LONG contracts, or would it close only that LONG contract which was generated by a previous "Slow MA CrossOver" ?

      Comment


        #4
        Hello,

        Based on what is provided, because you are using unique entries the opposing order with the same signal name should be matched with the signal name.

        For this type of question, I would suggest running this code on your side so you can see the results in a chart. Afterwords you could right click the chart and select Strategy Performance to see the trades and how they were matched.

        Because you already have the script typed out and compiled on your end, it would be best to test this from your side in a chart. In the case the result you get is un explainable you could certainly provide the syntax along with any images/questions you have on that result for further clarification.



        Please let me know if I may be of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X