Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to stop Intrabar Trading while using 'On each tick' Strategy Builder NT8

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

    How to stop Intrabar Trading while using 'On each tick' Strategy Builder NT8

    I am using Strategy Builder and need to utilize "On each tick" or "On price change" for dynamic control of the stop loss. Although my logic conditions show that the calculation should be done on close of the current bar, I keep seeing the real trades on live testing being taken intra bar and opposite of the logic. I can only assume that at some point during the bar that the condition was true--I am specifically talking about the 3 trades shown with the blue bar. If done correctly, there would have been a short here instead of a long. Also, if you look at the entries , you can see they are occurring while the bar is being constructed instead at the close.

    Is there a way to stop this from happening without unlocking the code?

    Also, is there away to make this forum searchable? I'm quite sure you've probably already answered this question for someone elsewhere, but there is no way to search as far as I can tell.Click image for larger version

Name:	TODAY'S TEST ACTION 09092021.JPG
Views:	269
Size:	264.9 KB
ID:	1170594

    #2
    Hello Juggernaut_Trades,

    Thanks for your post.

    At the top of each topic/thread, there is a search bar.
    Click image for larger version

Name:	topicSearchBar.PNG
Views:	331
Size:	35.9 KB
ID:	1170597

    At the top of the page, there is a search bar.

    Click image for larger version

Name:	ForumSearchBar.PNG
Views:	292
Size:	25.4 KB
ID:	1170598


    When a strategy uses intrabar processing (IE: Calculate.OnEachTick or Calculate.OnPriceChange), on live or Playback with Market replay data, it is possible that your entry conditions can be true many many times per bar.

    To limit your conditions to being true once per bar you will need to add another condition that can only be true once per bar. The easiest way to do this is to create an int type variable called "EntryBar. Add the condition Miscv>Current bar, NOT Equal, UserVariable>EntryBar. In the actions section, add the action Misc>Set EntryBar and in the "field, click "set" then select Misc>CurrentBar.

    What happens is that when your entry conditions are true, the first time in the bar, Current bar will not be equal to the EntryBar so these true conditions will allow the action of placing your order and setting the EntryBar equal to the Current Bar. On the next tick or price change, your entry condition may still be true however now Current bar is equal to EntryBar so the condition would be false and thus no action will occur at least until the next bar.

    Here is a short video on how to construct this: https://paul-ninjatrader.tinytake.co...Nl8xNDc5OTg3Mg

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    72 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X