NexusFi: Find Your Edge


Home Menu

 





OnBarClose true for indicator false for strategy


Discussion in NinjaTrader

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




 
Search this Thread

OnBarClose true for indicator false for strategy

  #1 (permalink)
 
spinnybobo's Avatar
 spinnybobo 
Crete, IL/USA
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
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
 
Code
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:	154
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 NexusFi?
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
16 thanks




Last Updated on April 5, 2013


© 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