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 in need again of help. Sorry
I am trying to blank out certain times that I want the strategy to ignore.
The code seems to be ok, but it isn't enforcing it. I have debugged it and the sessions are correct, but for some reason it is not enforcing it on the condition set.
Is there a way of enforcing an open position to exit at 30sec before the session time? I found something on the NInja chat, but couldn't get it to work either.
Any ideas please?
ToTime is just a converter to make it easy to test against using a numbers like 080000 for 08:00:00am (hours:minutes:seconds).
Time[0] is the time of bar 0. So it works for historical data (backtesting) as it's tested against the bar time, not against the current PC clock time. In other words, in real live trading, Time[0] will be based on the time of the last close of the bar, and it's the same for historical.
Hi Mike
Thanks for the guide. I should do this as it tells me what my code is talking about.
My times seem to be valid. I run the script and the "draw vert lines after the time code draws the lines in all the correct places. What doesn't seem to be happening is the enforcing of it, to the place a trade signal. ie, trades are still being taken in times that I have deemed to be out of bounds.
Any ideas?
Ok. Well I am giving up.
I thought that using the totime sets the parameters and that the trade entry requirements after it will only execute if the totime parameters are met.
Just goes to show how much I understand C# and the Ninja guides.
Oh well. Another idea wasted. I am wasting so much time trying to get a strategy to work.
I am better to go back to my old ways of manually backtesting. I realise that this is a backwards move, but the wizard and Ninja guides are frustrating me.
Thanks Mike for trying to help.
Backtesting can be the wrong path. I've blogged about that.
But, if you are giving up because of ToTime() then you are 99.9% there, in this post I already provided an example specifically showing how not to trade. It's called "return;". You can { Drawyourlines(); return; } and that will prevent the script from continuing further and thereby not executing your Enter() command.
Thank you Mike. I can't believe that all my problem was a "return;" missing. Aghhh
I promise that I will no longer look at C# programming
I promise that I will no longer look at C# programming
I promise that I will no longer look at C# programming
I promise that I will no longer look at C# programming