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 Belfortbucks, Today, 09:29 PM
      0 responses
      3 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      150 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Working...
      X