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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    62 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    33 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    44 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    58 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Working...
    X