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)
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
Hello,
I am trying to figure out how to program a strategy with the following criteria:
Uses an Indicator that is OnBarClose = True
Then, for example, we will use the Swing indicator in NinjaTrader for this example:
On the 1 min chart of ES, we have the Swing indicator. Let's say we go long when the price
which is OnBarClose = False
So, we have a strategy that enters based on OnBarClose = False and takes its entry off of an
indicator that OnBarClose = True.
I also think that there would only be one value for swing high, and one value for the swing low --- the last most recent value. So, the only thing I can think of is storing the value like
in an indicator I create called "ESSwinger" or something that specifically is reading the Swing values. Then, in my strategy I would import the ESSwinger, but then I realize that each chart itself has its own environment of OnBarClose = True or False or is it possible to configure the General part of the chart settings in the #region properties?
Or do I need 2 charts: 1 running the Swing indicator and saving the last value of bullish and bearish, and the strategy which just looks at the last current value and if price goes above the swingHighLevel by 1 tick, GoLong set ATM strategy
if price goes below swingLowLevel by 1 tick, GoShort and set ATM strategy
I am not clear on the best way to implement this.
I even thought about exporting values to txt, but then I don't want to run into concurrency problems of constantly checking (opening and closing the txt file) by the OnBarClose = false and then trying to write the data each minute from the other one.
Can you help answer these questions from other members on NexusFi?