Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

entry and exit orders

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

    entry and exit orders

    Hello,

    I'm trying to run the code below but NT8 does never execute any of the exit signals.

    What am I doing wrong?

    Thanks!

    Code:
    if (Position.MarketPosition == MarketPosition.Flat)
    			{	
    				if (whateverLONGsignal) 
    				{
    				EnterLong("EnterLong");
    				}
    			
    				if (whateverSHORTsignal) 
    				{
    				EnterShort("EnterShort");
    				}
    			}
    			
    			if (Position.MarketPosition == MarketPosition.Long)
    			{
    				if (differentsignal)
    				{
    				ExitLong();
    				}
    			
    			else if (Position.MarketPosition == MarketPosition.Short)
    			
    				if (anothersignal)	
    				{
    				ExitShort();
    				}
    			}

    #2
    Hello TexFly,

    Thank you for your note.

    When you enable the strategy, what color is the strategy on the strategies tab? ex Green or Yellow?

    Are you seeing any errors on the log tab?

    If you add the following at the top of OnBarUpdate and enable the strategy, are you seeing any action?

    if(State == State.Historical) return;

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X