NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 09-13-2007, 08:28 AM   #1
Mike Winfrey
Senior Member
 
Join Date: Aug 2007
Posts: 310
Thanks: 3
Thanked 2 times in 2 posts
Default Refresh Issue during live market

I have a custom indicator that colors bars either red, green, or gray. I have calculate on barclose set to false so I can see what's going on just prior to barclose. These bars may change color several times during the life of the bar. However, many times upon barclose the bar is the wrong color. I can reload the script and the bar is correct. Can you offer any assistance why this might happen. The code is pretty simple. It is contained in the OnBarUpdate() method and checks that other CCIs that are superimposed are pointing are either rising or falling. This occurs at line 246.

Can you please offer any suggestions as to why they don't paint properly. I have other custom indicators that do the same thing. Quite frustrating because I can't depend on the entry being correct.

Thank you,
Mike Winfrey
Attached Files
File Type: cs Adaptive_CCI.cs (24.4 KB, 13 views)
Mike Winfrey is offline  
Reply With Quote
Old 09-13-2007, 09:33 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

I would add Print() statements that include

CurrentBar.ToString() + conditionValue that changes the bar color + codeLocationMarker such as line number

Run this in real-time, save the output, reload it.

On reload, you should have one output per bar. You can then real-time ouput to reload ouput. The last line before CurrentBar rolls to a new one should plot out the same value as the reload output.

Once you have this data, you can see in your code what might be causing an issue.
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IB data refresh concerns rokafella Charting 6 08-15-2007 09:34 AM
Chart refresh with certain strategies BradB Automated Trading 3 07-09-2007 09:16 AM
Cross Hair causes all Icons to refresh on Desk Top Bruce_Medford_OR Charting 3 05-31-2007 08:49 AM
IB Historical Data Refresh Limits and Backup Feed Drew Connecting 1 05-10-2007 05:18 PM
Refresh problem MrBaffalo Indicator Development 5 01-23-2007 10:32 AM


All times are GMT -6. The time now is 12:04 AM.