Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Easy Event Question

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

    #16
    Originally posted by delTik View Post
    if(v<1)
    {
    EnterLong(1,"EL1");
    v = 1;
    }
    So let's say EntriesPerDirection is set to 2. This condition returns true on one bar, the single entry is submitted. Then the condition returns true on the following bar, now another entry is submitted as the EntriesPerDirection is allowing up to 2.

    Comment


      #17
      Originally posted by NinjaTrader_PatrickH View Post
      So let's say EntriesPerDirection is set to 2. This condition returns true on one bar, the single entry is submitted. Then the condition returns true on the following bar, now another entry is submitted as the EntriesPerDirection is allowing up to 2.
      In your example, V is set to 1 so the entry should only occur once unless v is set to another value elsewhere in the code.

      Comment


        #18
        ok thanks Patrick. clearly I'm doing something wrong but the attached strategy shows 2 execution events in the log.
        Attached Files

        Comment


          #19
          Hello delTik,

          Thanks for your post.

          I've run your script and I am only seeing one execution. In the log file I see the message when the order is entered from your log code in OnBarUpdate method and then I see the message from your code from the OnExecution method.

          The log messages seen are:
          [--2--] 5113 (7/21/2016 9:35:00 AM) Filled: EL1, qty 1, price 2164.75
          [--1--] 5113 (7/21/2016 9:35:00 AM) EnterLong(1, EL1)


          I'm not sure I understand what your question is but there is only one execution and shows a quantity of 1, there are two log messages that you placed in your code.

          Is what you are seeing different? (other than price).

          Comment


            #20
            thank you, that's strange now I'm only seeing

            [--2--] 5113 (7/21/2016 9:35:00 AM) Filled: EL1, qty 1, price 2164.75
            [--1--] 5113 (7/21/2016 9:35:00 AM) EnterLong(1, EL1)

            yesterday it was

            [--3--] 5113 (7/21/2016 9:35:00 AM) Filled: EL1, qty 1, price 2164.75
            [--2--] 5113 (7/21/2016 9:35:00 AM) Filled: EL1, qty 1, price 2164.75
            [--1--] 5113 (7/21/2016 9:35:00 AM) EnterLong(1, EL1)

            but unfortunately I don't have the log file. no matter thank you.

            Comment


              #21
              Hello delTik,

              Thanks for your reply.

              Actually you do have your saved log file unless you specifically deleted it. The log file can be found in Documents>NinjaTrader8>log It will be listed by year, month,day and then a number corresponding to the number of restarts on that day.

              Comment


                #22
                it's ok, I delete the log files with a batch file before starting up NT. As long as I get 1 event that's ok.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                558 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                324 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                545 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                547 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X