View Full Version : Indicator updates
sdooley
03-20-2007, 12:45 PM
Hi,
I trade a JPY currency pair whereby one of my
strategies is to "TAKE LONG" when pair breaks
"Previous Day High". The NinjaScript is working fine
except that the Previous OHLC doesn't update on the
charts. (if it's after 12:00AM, I have to log-off and
start a new chart to get the previuous OHLC to update)
Is there a scripting method to do some sort of
"hard-refresh" so that the Previous OHLC will update
when 12:00AM arrives?
thanks,
Steve D.
NinjaTrader_Ray
03-20-2007, 01:02 PM
Hi Steve,
I don't think the problem is that the indicator is not updating, if it was not you would not see any lines in the current (new day) for this indicator. Must be a logic issue. I looked at the code and I can't see any logic flaw so I will have to run a test on it.
Will get back to you after further investigation.
Ray
sdooley
03-20-2007, 02:46 PM
Thanks for the note Ray. I've tested this on 2 machines. The first machine I keep on thru midnight (close of day) and the Previous High just keep going across horizontally at the same position on x-axis. (So since this is after midnight, it's really giving you the previous "day-before yesterday high"if you know what I mean. I re-logged in with second machine at 12:30 AM and the previous high is updated to reflect the true previous high.
-Steve d.
NinjaTrader_Ray
03-20-2007, 02:55 PM
Right, which is the strange thing since once 12:00 is crossed, there isa reset logic for the new day. Either case, my development team will look into this.
Can you confirm that this occurs on the latest Beta 9 build?
Ray
sdooley
03-21-2007, 06:08 AM
Hi Ray,
Yes, I reset my time zones to make "now" midnight on the charts and yes, it occurs on both the Beta 8 and Beta 9 build. When I start a new chart at 12:07AM,previous OHLC is updated. Is there a way to programatically say "OK, it's 12 AM recalculate Previous OHLC" without manually closing chart?
Thanks,
Steve D.
NinjaTrader_Ray
03-21-2007, 06:51 AM
Steve,
I can't reproduce it here. Works as expected. As soon as midnight rollsover, the opening bar of the new calendar day sets the new Prior OHLC values. What chart interval are you using?
Ray
NinjaTrader_Ray
03-21-2007, 07:15 AM
Steve,
I was able to reproduce it. Please try this indicator and let me know if it resolves it.
Save an unzip the attached file in My Documents\NinjaTrader 6\bin\Custom\indicator
Via NT Tools > Edit NinjaScript > Indicator, open any file
Within the editor that opens, press F5, this will copmile the new indicator.
sdooley
03-21-2007, 10:14 AM
Hi Ray,
I'm on a 5 minute interval. Ref: the zip file that you sent... this "PriorDayOHLC.cs" overwrites the old one, correct?
I'm not having any luck with the new file. What time interval did you use?
-steve d.
NinjaTrader_Ray
03-21-2007, 10:26 AM
Yes, overwrites the previous one.
I used tick charts and second charts.