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)
Splitting one big IF in different sinlge "OR"-parts
I am having a logical problem with the "if-solution", that I got here in this forum from a very helpful person
This code works perfect in the case, that different conditions are working at one time, if activated with "true" in the parameter list. With deactivating als false I can reduce the conditions. So the "if" are connected with an imaginary "and".
If I want to use this structure in case of imaginary "or" for different stopp conditions, I cant use this with "if". I need an "or"-connector - but with "else if", "else" or reverse order or the negation with "!" like (!activEntry1) I cant build the scenario. I tried a while and with debugging - but I did not find the way of solution, that is working.
Have you got an idee or can telling me, what I am doing wrong?
This is, what I am searching (but not in one statement - I need 4 single statements:
Thank you for open my eyes.
Best regards,
Renkotrader
Can you help answer these questions from other members on NexusFi?
I reduced my project for this example. It is compiling without errors, but its not works. That means: no results. I hope, that I did not generated a new bug.
In this example are only four time exits - no other kind of exit strategy:
a) open COMEX/NYMEX
b) open NYSE
c) close XETRA
d) End of trading day
You did not say what went wrong. I've observed something in your script: the way you've defined your exit time may not be effective because it doesn't account for the possibility of a trading day spanning two days. For instance, the ES market opens at 18:00 ET but closes at 17:00 ET on the following day. To address this, consider using the SessionIterator to accurately assign time values to your variables to assign the correct time to your variables:
1. The time zone, the nightly break, is not a problem in my case. The reason is: I am German and I am working inside the Central European Time zome. That means: our trading days in Futures are starting at 00:00 o'clock and they ends at 22:00 at EUREX or 23:00 at CME. The only problem could be there, if Germany or the USA are switching to summer or winter time, because there is a time period from three weeks difference, for that the periods are not synchronized. But I will take a look in your Indicator - its looks very professional.
2. I had forgotten to put an entry condition in my example script. Here is the complete example script, that is working. So another very good job from you and I am saying "thank you!".
3. Another problem with the script is, that I am using its with a renko bar type. I added "AddDataSeries(BarsPeriodType.Minute, 1);" and this works well in combination with "if (BarsInProgress == 0)" and "if (BarsInProgress == 1)", if I am using time candles. So in using the close for a candle in my strategy, the fix exit for example 14:20 is working at 14:21 instead 14:25 at 5-minutes-chart. Same to other higher time bars. But in using renko bars it is not working. Have you got a solution for me in this?
4. I tried to move the time conditions for "Exit Long" and "Exit Short" to "OnExecutionUpdate", because this is the right place, if I am understanding the things. I dont know, why the startegy builder is not doing its. So I made each thing in "OnBarUpdate". If I am moving the code in this section, then the 4 activating/deactivating buttons in the parameter list are having no effect. That means: ignoring the decission for "on". For that an idea or a solution would be great, too.
Have a great day,
Renkotrader
Elite Membership required to download: ExampleActiveFilterWithOR2.cs