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 noticed that when you apply a template (i.e. excluding certain times of days; CME US Index RTH, etc.) to a chart or strategy, the gap wrecks allot of indicators (example attached).
Is it possible to enter directly into a strategy's code what time of day it should execute, so the default 24/7 template may be used to avoid gaps indicators?
"A Jedi's strength flows from the force."
-Yoda
Can you help answer these questions from other members on NexusFi?
I think Time[0] yield something like a string. I think 8AM is 80000, so something like this may work (or get you close):
&& Time[0] >= 80000 && Time[0] <= 120000
I don't think they need to be strings but something along this line will work. I have it in a few indicators and will look when I get home if you still need it.
Try this if the above doesn't work:
&& Time[0] >= "080000" && Time[0] <= "120000"
Be sure to add the leading 0 on the single digit times.
Yes, it is possible. My strategies only trade during specific times of the day. For example, if you have a breakout strategy you may not want to trade the false breakouts in the early afternoon.
Best you define some TimeSpan variables for the start and end times during which you want to enter positions. Then serialize these variables to make them accessible. Code a flag to check whether your current bar is within one of those time intervals. If this is the case allow for order execution.
yet still does not work... the session template works, but not the time code. Session template doesn't work for me because of price gaps leading indicators to give bad readings.
I made a thread on the NT board, and only had snide responses from the rep (Ryan). I wrote an example program that was an EMA/SMA cross, and he told me to go back and make it simpler. Obviously not even looking at what I wrote for him. Crap bugs in software are fine if you can work around them and make it better for everyone, but not idiot programmers who are as efficient as a steam engine with holes telling me yet again to look at myself so their managers won't bring the hammer down on them.
Also one quick update... to be clear, I'm trying to get the strategy to execute only during certain times of days. Maybe this function isn't what this is for...
I did implement it a little complex and not sure how this will work in the wizard, but you might be able to round off to the Hour or something to make it simpler
m_Time=Time[0].Hour.ToString("D2")+Time[0].Minute.ToString("D2")+Time[0].Second.ToString("D2");
m_InTimeWindow=Filter_TimeWindow(m_Time,m_TimeStart1,m_TimeEnd1);
Here is the function Filter_TimeWindow():
You might be able to use the "Time[0].Hour" which returns an Int.