Repainting Historical Bar - NinjaTrader Programming | futures io social day trading
futures io futures trading


Repainting Historical Bar
Updated: Views / Replies:1,484 / 7
Created: by srgtroy Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Repainting Historical Bar

  #1 (permalink)
Elite Member
Los Angeles, California Republic
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: ES, Mongolian Horse Futures
 
srgtroy's Avatar
 
Posts: 1,456 since Jan 2011
Thanks: 1,009 given, 2,238 received

Repainting Historical Bar

I'm trying to create a situation where if a bar meets a certain condition it gets painted red, however, if the bar following it fails to meet another condition, the initial bar gets re-painted dark red.

Here is my code:

if (BoolSeries1[0])
{BarColor = Color.Red;
}

if (Historical && BoolSeries1[0] && !BoolSeries2[-1])
{
BarColor = Color.DarkRed;
}


Why is it painting the following bar dark red instead of the initial one?

Reply With Quote
 
  #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.

 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,354 given, 83,237 received


Historical is only true while backtesting or while a chart is being loaded/drawn for the first time after you open it. It is not true once it is fully loaded.

That said, I can't help with how to paint backwards on the price bars - don't have ninja installed anymore - but as for making an indicator repaint all you do is modify the array 1 bar back, like:

myArray[1] = newValue;

Probably similar for price bars. Hopefully someone can help.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #4 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received


srgtroy View Post
I'm trying to create a situation where if a bar meets a certain condition it gets painted red, however, if the bar following it fails to meet another condition, the initial bar gets re-painted dark red.

Here is my code:

if (BoolSeries1[0])
{BarColor = Color.Red;
}

if (Historical && BoolSeries1[0] && !BoolSeries2[-1])
{
BarColor = Color.DarkRed;
}


Why is it painting the following bar dark red instead of the initial one?

dont know what exactly u r upto but if -1 represents previous bar then it should be only 1.

Reply With Quote
The following user says Thank You to bukkan for this post:
 
  #5 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


srgtroy View Post
I'm trying to create a situation where if a bar meets a certain condition it gets painted red, however, if the bar following it fails to meet another condition, the initial bar gets re-painted dark red.

Here is my code:

if (BoolSeries1[0])
{BarColor = Color.Red;
}

if (Historical && BoolSeries1[0] && !BoolSeries2[-1])
{
BarColor = Color.DarkRed;
}


Why is it painting the following bar dark red instead of the initial one?

I did not answer this in the first place because several things are confused. So let me summarize:

-> BarColor will only paint the current bar, you cannot use it to paint back.
-> "Historical" cannot be used this way. "Historical" refers to historical data as stored in the historical data base.If you connect to a data provider, typically NinjaTrader will backfill historical data for the time prior to connection and then collect real-time data. The previous bar, which you wanted to paint, can therefore be a real-time data bar. The use you made of "Historical" does not make any sense.
-> As @bukkan pointed out, if you want to reference the previous value of a BoolSeries, it would be BoolSeries[1], Boolseries[-1] will likely throw an out of range exception as the value has not been set.

What are you actually trying to achieve?

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #6 (permalink)
Elite Member
Los Angeles, California Republic
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: ES, Mongolian Horse Futures
 
srgtroy's Avatar
 
Posts: 1,456 since Jan 2011
Thanks: 1,009 given, 2,238 received

I define a Marubozu bar with a certain set of parameters. If the current bar meets those requirements, it gets painted green if it is an up bar or red if it is a down bar. However, the following bar is the confirmation bar. If it doesn't show sufficient follow through as defined by another set of parameters, then the initial Marubozu bar has 'failed' and that bar gets repainted a darker shade to show that status.

"-1" was used on purpose to refer to the next bar (confirmation bar), not the last bar.

The code was supposed to work like this: If this is the current bar, and it meets my definition of Marubozu, paint it red or green. However, if it is not the current bar, but it meets my definition of Marubozu, check the next bar and see if it has been confirmed. If it hasn't been confirmed, paint it the darker shade.

-> BarColor will only paint the current bar, you cannot use it to paint back.

I assume this means I cannot do what I would like to do as described above?

Thanks for your response and patience.

Reply With Quote
The following user says Thank You to srgtroy for this post:
 
  #7 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


srgtroy View Post
I define a Marubozu bar with a certain set of parameters. If the current bar meets those requirements, it gets painted green if it is an up bar or red if it is a down bar. However, the following bar is the confirmation bar. If it doesn't show sufficient follow through as defined by another set of parameters, then the initial Marubozu bar has 'failed' and that bar gets repainted a darker shade to show that status.

"-1" was used on purpose to refer to the next bar (confirmation bar), not the last bar.

The code was supposed to work like this: If this is the current bar, and it meets my definition of Marubozu, paint it red or green. However, if it is not the current bar, but it meets my definition of Marubozu, check the next bar and see if it has been confirmed. If it hasn't been confirmed, paint it the darker shade.

-> BarColor will only paint the current bar, you cannot use it to paint back.

I assume this means I cannot do what I would like to do as described above?

Thanks for your response and patience.

I just remembered that there is an easy way of doing what you want to do.

Instead of BarColor, you can use BarColorSeries. For example

 
Code
BarColorSeries[1] = Color.Red;
will paint the previous bar red. That should solve your problem. Sorry, should have seen this earlier.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #8 (permalink)
Elite Member
Los Angeles, California Republic
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: ES, Mongolian Horse Futures
 
srgtroy's Avatar
 
Posts: 1,456 since Jan 2011
Thanks: 1,009 given, 2,238 received

Wow! Great! Thanks!

Reply With Quote

Reply



futures io > > > > > Repainting Historical Bar

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book Discussion: Reading Price Charts Bar by Bar by Al Brooks cunparis Traders Hideout 530 October 19th, 2016 08:45 PM
Historical high/low data for advanced bar types RM99 Commodities Futures Trading 9 June 21st, 2011 09:53 AM
Image:al brooks reading price charts bar by bar.jpg Big Mike Trading Wiki Images 0 July 1st, 2010 09:00 PM
How do I get historical range bar data for NT? dlgoetz Reviews of Brokers and Data Feeds 6 March 7th, 2010 09:21 AM


All times are GMT -4. The time now is 10:42 PM.

Copyright © 2017 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
Page generated 2017-12-16 in 0.12 seconds with 19 queries on phoenix via your IP 54.227.51.103