OnBarClose true for indicator false for strategy - NinjaTrader Programming | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

OnBarClose true for indicator false for strategy
Started:April 5th, 2013 (08:57 PM) by spinnybobo Views / Replies:412 / 1
Last Reply:April 5th, 2013 (08:57 PM) Attachments:1

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

OnBarClose true for indicator false for strategy

Old April 5th, 2013, 08:57 PM   #1 (permalink)
Elite Member
Crete, IL/USA
Futures Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker/Data: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Favorite Futures: ES, CL, EUR/USD, TF
spinnybobo's Avatar
Posts: 171 since Aug 2009
Thanks: 99 given, 47 received

OnBarClose true for indicator false for strategy


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
OnBarClose true for indicator false for strategy-es.png  
Reply With Quote

Old April 5th, 2013, 08:57 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.



futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > OnBarClose true for indicator false for strategy

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
question regarding order generation and onbarclose KhaosTrader EasyLanguage Programming 3 October 27th, 2012 05:18 AM
COBC false indicators on COBC true strategy daydaxer NinjaTrader Programming 10 June 6th, 2012 02:56 AM
True or False Big Mike Off-Topic 147 June 2nd, 2011 05:19 PM
to get NT to perform an action only once while a strategy condition is true richwaters NinjaTrader Programming 3 February 28th, 2011 08:38 PM
True Or False - a serious thread trendisyourfriend Traders Hideout 7 October 23rd, 2010 05:31 PM

All times are GMT -4. The time now is 03:23 AM.

Copyright © 2016 by 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

Page generated 2016-10-22 in 0.06 seconds with 20 queries on phoenix via your IP