NexusFi: Find Your Edge


Home Menu

 





Exit on close of Bar


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one DavidBodhi with 1 posts (2 thanks)
    2. looks_two Abusamjad91 with 1 posts (0 thanks)
    3. looks_3 koganam with 1 posts (2 thanks)
    4. looks_4 Skistr with 1 posts (1 thanks)
    1. trending_up 1,625 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Exit on close of Bar

  #1 (permalink)
 Abusamjad91 
San Francisco California
 
Experience: None
Platform: NinjaTrader
Trading: futures
Posts: 70 since Oct 2020
Thanks Given: 56
Thanks Received: 59

Hello everyone,

I am working on some strategies and wanted to try exiting on the close of the same bar I'm entering on. Can someone show me how to achieve this on strategy builder? I searched on NT forums but couldn't accomplish it. I also lack the skills needed to do it on my own. Will appreciate all help.

Thank you
Abdus

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 
DavidBodhi's Avatar
 DavidBodhi 
Milwaukee, WI, USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Equities
Posts: 209 since Oct 2014
Thanks Given: 23
Thanks Received: 207

If your strategies are set to Calculate On Bar Close, the quickest exit you can make is on the open of the next bar.

If they are Calculate On Each Tick and if you're using time-based bars, you could add a 1-tick data series, count seconds or fractions thereof, and exit on the last one but, if there happens to not be a transaction on that tick, it still won't calculate till the next tick. If your bars are not time-based, I don't see a way, off the top of my head, to predict when the bar will close.

Probably easiest to exit at the open of the next bar. ES would likely not change significantly between Close[1] and Open[0], but some wilder markets might, in which case adding a 1-tick data series would be as close as you could get.

Might be possible with the Strategy Builder. Depends what, exactly, you decide to do.

At least, so I think at the moment.




Abusamjad91 View Post
Hello everyone,

I am working on some strategies and wanted to try exiting on the close of the same bar I'm entering on. Can someone show me how to achieve this on strategy builder? I searched on NT forums but couldn't accomplish it. I also lack the skills needed to do it on my own. Will appreciate all help.

Thank you
Abdus


Follow me on Twitter Reply With Quote
  #3 (permalink)
koganam
Garner, NC/USA
 
Posts: 39 since Dec 2009
Thanks Given: 16
Thanks Received: 42



Abusamjad91 View Post
Hello everyone,

I am working on some strategies and wanted to try exiting on the close of the same bar I'm entering on. Can someone show me how to achieve this on strategy builder? I searched on NT forums but couldn't accomplish it. I also lack the skills needed to do it on my own. Will appreciate all help.

Thank you
Abdus

As with all code-generators, the Strategy Builder can only do that which has been already programmed into it. You cannot do what you want in the Strategy Builder.

In NT, the close of the bar is considered to be coincident with the open of the new bar. If that is not satisfactory, you will have to manually code something different. Specifically you will have to act on the putative closing time of the bar. That would most likely mean that you will need to use a timer, which would trigger the action that you want, when the timer expires at the time that you want.

Reply With Quote
  #4 (permalink)
 Skistr 
New Orleans LA
 
Experience: Intermediate
Platform: Sierra NT TOS
Trading: Currency Futures
Posts: 9 since Sep 2019
Thanks Given: 3
Thanks Received: 1


Abusamjad91 View Post
Hello everyone,

I am working on some strategies and wanted to try exiting on the close of the same bar I'm entering on. Can someone show me how to achieve this on strategy builder? I searched on NT forums but couldn't accomplish it. I also lack the skills needed to do it on my own. Will appreciate all help.

Thank you
Abdus

I had this thought... to add something a little more hmmm, concrete to get it done in Strategy Builder.

in Strategy Builder create a group with 2 conditions that will close if either of these occur. You don't have to use groups, of course.

1. price is > close of the last bar [1]
2. price is < close of the last bar [1]

You could say if price is = to the close of the last bar [1], but then it may never be equal and if you want to make sure you get out... well the above may work.

Hope this helps you find the solution to what you have in mind.

Reply With Quote
Thanked by:




Last Updated on December 5, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts