• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

do not enter position

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

    do not enter position

    Hello. How to set
    if (condition)
    {do not enter position}

    #2
    Hello alexstox,
    Thanks for your post and I am happy to assist you.

    You can set a boolean field which can turn on/off as per required

    in variable
    Code:
    private bool doNotTrade = false;
    in OnBarUpdate
    Code:
    if (condition)
    {
       doNotTrade = true;  //do not trade
    }
    
    if (doNotTrade == false && entry conditions)
    {
        EnterLong();
    }
    Please let me know if I can assist you any further.
    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Ivantr, Yesterday, 05:24 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by ralett, Yesterday, 06:20 PM
    3 responses
    27 views
    0 likes
    Last Post ralett
    by ralett
     
    Started by trader252, Yesterday, 08:38 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by grizzlytrader, Yesterday, 06:24 AM
    1 response
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by andrewtrades, Yesterday, 01:43 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X