Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am running into an issue with an indicator originally published by johnthom and modified by fat tails. I am working on an automated strategy but want the strategy to exit all positions before certain economic news events. So I have modified the indicator to display an event area. I am calling the indicator based on X bars before the event. I also want to stay out of the contract until X bars after the event so I am plotting the bars before and after the event and calling this indicator to do that.
The issue here is that the bars before/after are plotting to the indicator called EventArea. It works when I reset the local machine time in market replay and test it in marketreplay. I can call EventType != 0 and have it close positions in a strategy when the local machine time is set to a high event (ive also created indicators for calling medium, low and specific events like oil/ng). What is strange is that when I run the strategy in sim on live data it does not trigger the exits for the open positions.
Going through someone else's code is annoying but if anyone is able to provide any help with this or point out where I may have done something wrong that would be great.
If anyone has a moment to help me troubleshoot this and let me know what I have done wrong so I can modify the other indicators that are similar for specific events that would be helpful. If there is a better way to do this then let me know as well... or if it has already been done.
Can you help answer these questions from other members on NexusFi?
I found an issue in the code on line 365 where it was not loading news if the timer != 0. This may have been the issue but I am not sure. I changed that line to == 0 and will test it again. Hopefully that was it.
// download the news data every news refresh interval (not bar interval).
if (lastNewsUpdate.AddMinutes(newsRefeshInterval) < DateTime.Now && Timer != 0){
changed to
// download the news data every news refresh interval (not bar interval).
if (lastNewsUpdate.AddMinutes(newsRefeshInterval) < DateTime.Now && Timer == 0){
Makes sense to me why it wasnt working... The strategy was not finding a news event to trigger because it would never have loaded news.
Doesnt make sense why when I plot the indicator on a chart it was displaying the news though. But I did notice that the indicator would have to be reloaded after a news event and would never refresh automatically to display them.
If this doesnt fix it then yes, ill be reaching out to everyone again in hopes to figure this out. I'll keep everyone posted. If anyone has been looking for similar behavior from an indicator I thought this was a good way to implement what I needed and could not find the behavior shared on the site.