Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question on stop orders

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

    Question on stop orders

    Hello everyone,
    I coded a nt 6 strategy, now I'm porting to 6.5 (last beta) but I'm experiencing something I do not understand, the piece of code below was perfectly working, I had a look to help files but i didn't find useful informations.
    Specifically, as you can see below, the strategy executes only the first order in the row (in this case EnterLongStop), no short trades are taken (while levels are perfectly printed). If I comment EnterLongStop the system enters only short trades....
    Any suggestions?
    Code:
    if (Position.MarketPosition == MarketPosition.Flat)
    					{
    						ExitOrderStatus = ExitStatus.Nothing;
    						try
    						{
    							// Definizione ingressi
    							if (Time[0].TimeOfDay.CompareTo(OperationTimeStop.TimeOfDay)<0 && (Close[0]<=ChannelHigh && Close[0] >= ChannelLow))
    							{
    								EnterLongStop(NContracts,ChannelHigh+TickSize*Sfond,"l");
    								EnterShortStop(NContracts,ChannelLow-TickSize*Sfond,"s");
    								#if DEBUG
    									Print(Time[0].ToString()+"-Enter Long["+(ChannelHigh+TickSize*Sfond).ToString()+"]- Enter Short ["+(ChannelLow-TickSize*Sfond).ToString()+")");
    								#endif
    							}
    						}	
    						catch (Exception ex)
    						{
    							Print("Gestione ingressi - Errore"+ex.StackTrace.ToString());
    						}
    Thanks

    Marce

    #2
    Look in the Help Guide section -->

    NinjaScript > NinjaScript Language Reference > Custom Strategy Methods and Properties > Order Methods > Overview

    Look at the bottom for the section "Internal Order Handling Rules that Reduce Unwanted Positions"
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    368 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    571 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X