Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Corresponding method of close button in trader section of chart

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

    #16
    Hello bosajin, thanks for your reply.

    This code works fine, there is something in your strategy you need to fix.

    Code:
    protected override void OnBarUpdate()
            {
                if(CurrentBar < 1) return;
    
                if(Close[0] > Close[1])
                {
                    EnterLong();
                }
    
                if(Position.MarketPosition == MarketPosition.Long)
                {
                    ExitLong(Position.Quantity);
                }
            }
    Consider making a copy of your current strategy and strip it down until you find the issue.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fastnet, Today, 10:58 PM
    0 responses
    1 view
    0 likes
    Last Post fastnet
    by fastnet
     
    Started by tradingbobby, Today, 10:41 PM
    1 response
    6 views
    0 likes
    Last Post s.kinra
    by s.kinra
     
    Started by bfalls, Today, 10:38 PM
    1 response
    7 views
    0 likes
    Last Post s.kinra
    by s.kinra
     
    Started by WHICKED, Today, 09:05 PM
    0 responses
    11 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by luislag14, Today, 06:29 PM
    0 responses
    8 views
    0 likes
    Last Post luislag14  
    Working...
    X