Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Enter on CalOnBarClose=True, but Exit Immediately on X Ticks
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
for me, using OnBarClose = false becomes problematic when you need values for each bar from things.
I don't know how it is with using indicators like SMA or stochastics and stuff, but if you use
Unless there is a different way that I don't know about, I am thinking this is how you would normally get around using OnBarClose = false through using FirstTickOfBar
When you compare using the same exact logic with
they don't always give the same values. Therefore if your strategy is heavily reliant on things being exact with data values, then it makes sense to use OnBarClose = true
If you have to backtest something, just
Add(PeriodType.Tick, 1); // to Initialize()
just make sure you download the data first before you load the chart so it does not take forever to load.
Yes, definitely looks timing related (FirstTickOfBar vs OnBarClose), as Close[0] changes with every tick. I will keep that in mind, but for now I have given up on NT, as support couldn't answer my questions on unmanaged strategies. The big issue is they have no Order.Close function like every other trading language I''ve used. And the only strategy they could point me to as an example is CamarillaPointsUnmanaged. One, when ran in real mode it bombs with an order reject. And two, it stops out or hits profit target. That's the only way to get out of the order.
If I missed something, I would love to know how to close an order. I entered a reverse BuyToCover or Sell to get out and sometimes it works, and sometimes it opens up new positions.