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
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for your help Bertrand!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by algospoke, Today, 06:40 PM
      0 responses
      2 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      6 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      6 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      168 views
      0 likes
      Last Post jeronymite  
      Started by cre8able, Today, 04:22 PM
      0 responses
      8 views
      0 likes
      Last Post cre8able  
      Working...
      X