NexusFi: Find Your Edge


Home Menu

 





UPdate strategy and bar colors


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 2 posts (2 thanks)
    2. looks_two forrestang with 2 posts (0 thanks)
    3. looks_3 Big Mike with 2 posts (1 thanks)
    4. looks_4 nanook77 with 2 posts (0 thanks)
    1. trending_up 3,186 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 2 attachments




 
Search this Thread

UPdate strategy and bar colors

  #1 (permalink)
 
nanook77's Avatar
 nanook77 
OKC, OK
 
Experience: Advanced
Platform: Ninja Trader, Trade Navigator. ToS
Broker: PFG/CQG
Trading: forex, futures
Posts: 23 since Jun 2010
Thanks Given: 84
Thanks Received: 8

Issue: Have a set of indicators that run with my strategy.

The 'calculate on bar close' is set to false.

The criteria that changes the color of the background or the bar, functions correctly. However, during bar formation and at bar close, the criteria does not update, so if the bar started in one direction and triggered the strategy criteria, and then reversed direction, the bar coloration and background coloration, remain in place (triggered).

This strategy is being implemented on 'Better Renko" bars - if that makes a difference.

Thanks in advance for any help on how to resolve this.

Even when you stand firm in the rushing waters of life - only your Spirit is Perfect!
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665



nanook77 View Post
Issue: Have a set of indicators that run with my strategy.

The 'calculate on bar close' is set to false.

The criteria that changes the color of the background or the bar, functions correctly. However, during bar formation and at bar close, the criteria does not update, so if the bar started in one direction and triggered the strategy criteria, and then reversed direction, the bar coloration and background coloration, remain in place (triggered).

This strategy is being implemented on 'Better Renko" bars - if that makes a difference.

Thanks in advance for any help on how to resolve this.

I read your post a few times but still am not clear. Your likely to receive the most help if you post your code so someone can look at it, and/or post a screenshot of what is happening vs. what should be happening.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
nanook77's Avatar
 nanook77 
OKC, OK
 
Experience: Advanced
Platform: Ninja Trader, Trade Navigator. ToS
Broker: PFG/CQG
Trading: forex, futures
Posts: 23 since Jun 2010
Thanks Given: 84
Thanks Received: 8


Big Mike View Post
I read your post a few times but still am not clear. Your likely to receive the most help if you post your code so someone can look at it, and/or post a screenshot of what is happening vs. what should be happening.

Mike

hope this is helpful Mike. attached zip file and picture with callout. All i want it to do differently, is update the bar color during formation and at bar close. that allows be to make a decision while the bar is forming if i want to make a trade entry, prior to the close of the bar, and place my order and trigger price.

again - thx in advance.

nanook77

Even when you stand firm in the rushing waters of life - only your Spirit is Perfect!
Attached Thumbnails
Click image for larger version

Name:	7-24-2011 2-07-42 PM  strategy problem.png
Views:	202
Size:	241.4 KB
ID:	44367  
Attached Files
Elite Membership required to download: HLCrossSlope.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665

I believe on FirstTickOfBar on the next bar, which is the first time you can do something after the current bar closes, you could go back and repaint the color of the prior bar if you want. But for a strategy, you would need to send it some kind of new signal via a dataseries.

I forget the syntax to do this, but I am sure others know, particularly @Fat Tails. Someone else recently asked this too.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


nanook77 View Post
hope this is helpful Mike. attached zip file and picture with callout. All i want it to do differently, is update the bar color during formation and at bar close. that allows be to make a decision while the bar is forming if i want to make a trade entry, prior to the close of the bar, and place my order and trigger price.

again - thx in advance.

nanook77

You have exported the strategy as DLL, so no one can read the code and help you.

Basically you have too options to deal with the problem:

(1) You store the old BackColor somewhere. If the condition is met you change it. If then the condition is not met for a consecutive tick of the same bar, you change it back to the old value.

(2) You wait until the first tick of the following bar is triggered. You then check whether the condition has been met by the previous bar, and use BackColorSeries[1] to change the background color for that previous bar.

Both approaches will eliminate false intra-bar signals.

Reply With Quote
  #7 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

Question:

If using a color bar that you are changing.... and you want it to run calconBarClose == false........

Say you where coloring an INSIDE bar, where the highs/lows of that bar are inside the prior bar. And say then one of the highs breaks the prior high intrabar.

So you're snippet would look like this:
 
Code
			if(High[0] < High[1] && Low[0] > Low[1]) 
			{
				BarColor = barColorInside;
			}
How do you change it back once that condition is no longer met, particularly intra-bar?

Reply With Quote
  #8 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


forrestang View Post
Question: How do you change it back once that condition is no longer met, particularly intra-bar?

You may try this:

 
Code
            if(High[0] < High[1] && Low[0] > Low[1]) 
            {
                BarColor = barColorInside;
            }
            else
                BarColor = Color.Empty;

Reply With Quote
Thanked by:
  #9 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


Fat Tails View Post
You may try this:

 
Code
            if(High[0] < High[1] && Low[0] > Low[1]) 
            {
                BarColor = barColorInside;
            }
            else
                BarColor = Color.Empty;

It must be the way I have this script structured, as I've tried this before and it produced undesirable effects.

Reply With Quote
  #10 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


if you want to change color of the past bar then use barcolorseries,


BarColorSeries



Definition

A collection of historical bar colors.



Property Value

A color series type object. Accessing this property via an index value [int barsAgo] returns a color structure representing the referenced bar's color.



Note: This will only return the color of a bar in which an explicit color overwrite was used. Otherwise it will return Color [Empty].



Syntax

BarColorSeries
BarColorSeries[int barsAgo]





Examples

// Sets the color of the current bar to blue.
BarColorSeries[0] = Color.Blue;



// Sets the color of the previous bar to orange.

BarColorSeries[1] = Color.Orange;

Reply With Quote
Thanked by:




Last Updated on November 7, 2011


© 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