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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    145 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X