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 butt_toast, 04-28-2021, 05:46 AM
      7 responses
      1,896 views
      0 likes
      Last Post Phrygian  
      Started by DeanJ, Today, 05:19 AM
      2 responses
      17 views
      0 likes
      Last Post DeanJ
      by DeanJ
       
      Started by Zinger357, 07-01-2024, 06:24 PM
      13 responses
      111 views
      0 likes
      Last Post Zinger357  
      Started by DJ888, Today, 06:03 PM
      0 responses
      7 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by DJ888, 07-11-2024, 09:28 PM
      2 responses
      21 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Working...
      X