Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get code to compile #2

Open
Mindset7of9 opened this issue Feb 7, 2023 · 1 comment
Open

Cant get code to compile #2

Mindset7of9 opened this issue Feb 7, 2023 · 1 comment

Comments

@Mindset7of9
Copy link

Hi
Copied and pasted your relvolavg code and it causes NT8 to crash FYI.

@michelpmcdonald
Copy link
Owner

Hi @Mindset7of9, sorry about the late response, just noticed.

If the code does not compile, I'm not sure what the issue is, guessing it's not a big deal, but my windows laptop broke, so I really don't have a way to check myself at this point.

If the code compiles, but crashes when it's run, i think it's missing history.

Not really working on Ninjatrader stuff too much these days, but, the issue with the relvolavg crashing is missing history.

SO, for example, for relvol on a 15 minute chart for the bar starting at 9:30, I go back in "history" and try to grab the 9:30 bar for X previous days.....lets say I can't find the 9:30 bar for 2 days ago, i throw an exception.

I have a few ideas on how to deal with a missing history bar...like for example:
Just skip it, so if your relvol period is 5 days, and your missing day 3, just calc the average period volume for 4 days.
Or average the bar before and the bar after the missing bar and use that for the missing bars volume.

Here is a link to where I throw an exception for missing history, so that would be the spot in the code to start to deal with it if you want to give it a go:

// If the returned bar is not the expected date, a bar with the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants