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 would suggest first getting the example I gave to work before separating the function out. I do not use NT any more, so can't test, but pretty sure you can't put the function in a remote strategy file, it needs to be in an indicator. But walk before you run, just keep it in the same strategy you are calling it from first.
{
//If the current bar times are equal to these, then call them in another strategy
if (ToTime(barTime) > ToTime(2,0,0) && ToTime(barTime) < ToTime (4,0,0))
if (ToTime(barTime) > ToTime(8,0,0) && ToTime(barTime) < ToTime (15,0,0))
if (ToTime(barTime) > ToTime(17,0,0) && ToTime(barTime) < ToTime (23,0,0))
return true;
Look at this advanced Murrey Math strategy I posted, it has lots of functions in it being called from OnBarUpdate and should be plenty to make it clear.
I wrote this strategy over a year ago for NT. I haven't looked at it in a year, but I've received dozens of requests from people who read about the strategy for me to sell it or give it to them, etc. I've always declined, but the fact is, …
My C# is a bit rusty, haven't written anything for NT in a long time now. It is private bool, not void bool, a mistake on my part in my original post above (void meaning nothing to return, and here you are returning a bool).
ManageOrders();
{
if (Position.MarketPosition !=MarketPosition.Flat) return;
// Condition set 1 for short
if (High[1] > High[0]
&& Close[1] < hmav[2])
&& (TimestoTrade(Time[0])==true))
{
GoShort();
Print(Time[0]+"Time is (bartime)");
}
}
}
I did move the method up to initialise but no effect; I appreciate my limited coding skills, now I am stuck. Any further thoughts? The irony is this was originally taken from NT code base.
hi Xeno
I am trying to set up a simple function that allows me to trigger different times [hours] of the day to trade. Rather than add those times to each separate entry condition I have tried to set this up with a simple function.
I have now run a debugged version of the code, which prints out true/false as you would expect, but when I run it in the actual strategy the function no longer seems to work. So, the strategy and the function in isolation seem to work, but not together.
Debugged is attached.
Elite Membership required to download: Swingtick5patt3profitlongshort (2).cs
hi Xeno
I am trying to set up a simple function that allows me to trigger different times [hours] of the day to trade. Rather than add those times to each separate entry condition I have tried to set this up with a simple function.
I have now run a debugged version of the code, which prints out true/false as you would expect, but when I run it in the actual strategy the function no longer seems to work. So, the strategy and the function in isolation seem to work, but not together.
Debugged is attached.
Then if I add back some conditions, function seems to stop functioning.
Elite Membership required to download: Swingtick5patt3profitlongshortthree.cs