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

adding dataseries/instruments

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

    adding dataseries/instruments

    Hello,

    I´m adding Add("NQ 09-18", PeriodType.Range, 8); to a script that should trigger entries in ES. Since I added the NQ for checking conditions it occurs now that there are entries not only in ES but also in NQ. How do I avoid this please and to specify entries in ES.

    if(conditions ES and conditons NQ...)
    {entryOrderS1=EnterShort(1,"S1");}

    How to avoid entries in NQ please?

    Thank you!
    Tony
    Last edited by tonynt; 08-04-2018, 05:22 AM. Reason: typing error

    #2
    Hello Tonynt,

    Thank you for writing in.

    You should specify the bar index in the enter short call.

    Please see the last syntax at the following link which includes BarsInProcessIndex,


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello AlanP,

      thank you for your reply. So the "EnterShort(int barsInProgressIndex...." is determining which instrument/dataseries is triggered. I didn´t see this, I was focused on the example below where is only the signal name. Thank you for showing up.

      Another question please: I attach a screenshot where you can see that in the log-tab the profit-target is updating all the time. But I have a bool in onbarupdate so that profit target is updated only when a condition change is true. Why is it updating all the time? (I have different scripts running so I´m afraid thousands of lines in log will cause issues maybe)


      Thank you!
      Tony
      Attached Files

      Comment


        #4
        Hello tonynt,

        Without the full code we're unable to test on our end.

        If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by devatechnologies, 04-14-2024, 02:58 PM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tkaboris, Today, 08:01 AM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by BarzTrading, Today, 07:25 AM
        1 response
        11 views
        1 like
        Last Post NinjaTrader_Clayton  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        161 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X