Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

It should Enter but It doesn´t

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

    It should Enter but It doesn´t

    Hi!
    I am having a really Headache with a bad entry. Here is my code:

    Per1=20

    if (Position.MarketPosition == MarketPosition.Flat && ADX(14)[0]<25){

    if (High[0]>=APZ(2,per1).Upper[0]) EnterShortStop(APZ(2,per1).Upper[0],"Vende");
    if (Low[0]<=APZ(2,per1).Lower[0]) EnterLongStop(APZ(2,per1).Lower[0],"Compra");

    if (Position.MarketPosition != MarketPosition.Flat && BarsSinceEntry() == 4){
    ExitLong();
    ExitShort();
    }

    As you can see, Conditions fulfilled at the first red bar of the image, so an enterLongStop is sent to the next green bar. However, there is not such entry...

    If I write "EnterLongStop(APZ(2,per1).Lower[0] + TickSize,"Compra");" or "EnterLongLimit(APZ(2,per1).Lower[0],"Compra");", then, the strategy enters Long.

    Could somebody help my with this issue?
    Thanks in advance!
    Attached Files

    #2
    ppr4826, first I would suggest add a drawing object / print statement to your conditions so you can really be 100% sure an order should be placed from the way it's setup.

    Next work with TraceOrders in your script to see if you're running into any ignored orders here due to NT's internal order handling rules - http://www.ninjatrader.com/support/f...ead.php?t=3627

    To read more about the 'under the hood' order handling rules of the managed approach in NT, please see the last section of this link here - http://www.ninjatrader.com/support/h...d_approach.htm

    Comment


      #3
      Thanks for your help Bertrand!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      72 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      43 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      25 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      28 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      58 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X