NexusFi: Find Your Edge


Home Menu

 





Help With Econnews Indicator


Discussion in NinjaTrader

Updated
    1. trending_up 1,227 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 2 attachments




 
Search this Thread

Help With Econnews Indicator

  #1 (permalink)
 
PlayingGoFish's Avatar
 PlayingGoFish 
Denver
 
Experience: Intermediate
Platform: NinaTrader 7
Trading: ES, Gold, Oil
Posts: 23 since May 2016
Thanks Given: 3
Thanks Received: 18

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.

Attached Files
Elite Membership required to download: jtEconNewsHigh.cs
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
  #2 (permalink)
 
PlayingGoFish's Avatar
 PlayingGoFish 
Denver
 
Experience: Intermediate
Platform: NinaTrader 7
Trading: ES, Gold, Oil
Posts: 23 since May 2016
Thanks Given: 3
Thanks Received: 18

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.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #3 (permalink)
 
PlayingGoFish's Avatar
 PlayingGoFish 
Denver
 
Experience: Intermediate
Platform: NinaTrader 7
Trading: ES, Gold, Oil
Posts: 23 since May 2016
Thanks Given: 3
Thanks Received: 18


Attaching this for a member who messaged me.

Attached Files
Elite Membership required to download: jtEconNewsOther.cs
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on March 28, 2017


© 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