OnBarClose true for indicator false for strategy - futures io
futures io futures trading

OnBarClose true for indicator false for strategy

Discussion in NinjaTrader

    1. trending_up 2,714 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 1 attachments

Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Search this Thread

OnBarClose true for indicator false for strategy

(login for full post details)
  #1 (permalink)
Crete, IL/USA
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
spinnybobo's Avatar
Posts: 181 since Aug 2009
Thanks: 103 given, 56 received


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
public double swingHighLevel;
public double swingLowLevel;
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.

Attached Thumbnails
Click image for larger version

Name:	es.PNG
Views:	42
Size:	35.4 KB
ID:	107874  
Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
ZigZag with Depth and Backstep
EasyLanguage Programming
MACD line not plotting after change of plot order
Indicators for pair trading MES and M2K
Platforms and Indicators
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
111 thanks
Selling Options on Futures?
109 thanks
Rank your Futures vs Stocks trading priority
37 thanks
Want your NinjaTrader indicator created, free?
26 thanks
Bitcoin storage wallet recommendations
18 thanks

futures io Trading Community Platforms and Indicators NinjaTrader > OnBarClose true for indicator false for strategy

Last Updated on April 5, 2013

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Battlestations! Show us your trading desk - $1,500 in prizes!


Importance of Finding Your Own Way w/Adam Grimes

Elite only

Journal Challenge w/Jigsaw


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts