Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Basic questions

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

    Basic questions

    If I wrote a code in the OnBarUpdate()

    if (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 93300)
    EnterLong ();

    Does the above code enter a long position 3 times or just once?



    also, what is the easiest method of writing code that says....Enter a long limit order of 2 points above current price? and Enter a short position limit order of 3 points below current price? Is the below correct?

    EnterLongLimit(Close[0]+2)
    EnterShortLimit(Close[0]-3)


    Thanks in advance

    #2
    On your first question, please see this reference for the answer:



    Look at the section on "Defining how Entry Methods are processed..."

    On your second question, in NT6.5 you will not be able to submit two simultaneous entry orders. However, the correct syntax would be:

    EnterLongLimit(Close[0] + 2 * TickSize);
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    578 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 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
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X