Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Entry condition inconsistency

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

    Entry condition inconsistency

    I have run a strategy with simple entry condition.
    Action, target and stop conditions are set simply. Buy or sell, 4 tick profit, 4 tick stop.

    I run the strategy and get 346 entries, with 40% profitable rate.

    I then reverse the strategy actions for the condition, so that in either case it sells instead of buys, or buys instead of sells.

    The entry condition, target and stop remain exactly the same.

    I run the strategy again. I assume I will see 346 entries again, as the entry condition remains exactly the same, only the “action” has been reversed, and actions don't effect the original condition.

    Only, to my shock, this time I get 340 entries.

    This does not make sense to me, the entry condition is exactly the same, only the action differs…. why would the number of entries change?

    #2
    Hello ScottieDog,

    Thank you for your post.

    Set the Fill Type to Liberal with a Slippage of 0 in the Strategy Analyzer and run both tests again. You should see the same number of trades.

    Due to how the Default Fill Type handles the different order types (Stop Market for Stop Loss vs. Limit for Profit Target) the fills occur at different times.

    You can view the code for Liberal and Default fill types under Documents\NinjaTrader 7\bin\Custom\Type on your PC. The two files are named @DefaultFillType.cs and @LiberalFillType.cs.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    9 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    7 views
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    28 views
    0 likes
    Last Post wzgy0920  
    Working...
    X