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)
When to use BoolSeries rather than simple variable
Is there ever any reason to use a xSeries (where x is Bool, Data, etc.) other than as required for processing logic or as required by a given indicator? i.e. are there some situations in NT in which one should use these?
Can you help answer these questions from other members on NexusFi?
Boolean logic is used all the time. I've written functions to return True or False values. Example: "If FileExists then" - the value returned by the function(FileExists) is either True or False. If the statement is True do this, if the statement is False do that.
By using Gates such as AND or OR within an IF statement also processes the outcome as being True or False.
True or False is the same as 1 or 0 in memory. Checking a value like xyz = str would use more memory making it less efficient. Boolean logic uses less memory which would execute the code faster. The compilation of the code should be smaller. Some compilers will optimize the code automatically for you.
There's no right or wrong answer. Code should be as streamlined as possible. Execution of the code should be quick for indicators.
its because dataseries stores the data of ALL previous Bars in the chart
but doubles like double eco01 = (ECO2(21,45,8,6)[1]);
only stores the value of the bars you need at the moment of your calculation.
Yes... been many years for me as well... and I never did OO programming... I'll have a look... my question was more specifically w/in NT... as far as the data structure itself... BoolSeries vs. variable
wh.. not following you.. was this meant for someone else? I was asking about making a decision when writing custom code... on whether or not a variable should be set up as a simple variable or as a BoolSeries... Maybe I'm missing something.. but thought you might have meant this for some other question...
yep... that's it... someone also mentioned to me that if (for testing or future "look-back") one wants to see past data displayed in the data box, it would have to be set up as a Series. I assume that there are some methods that might require a series, but that is just conjecture... I'm just starting to dig into coding and although I've done a lot of programming in my life... not since 1985 and never OO.