When to use BoolSeries rather than simple variable - NinjaTrader Programming | futures io social day trading
futures io futures trading


When to use BoolSeries rather than simple variable
Updated: Views / Replies:2,574 / 11
Created: by Saroj Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

When to use BoolSeries rather than simple variable

  #1 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

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?

Reply With Quote
 
  #2 (permalink)
VIP Member
FL
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, 6E, CL
 
Posts: 71 since Jul 2009
Thanks: 159 given, 32 received

It's been quit a few years since I've programmed.

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.

Here's a link that helps describe Gates.
HowStuffWorks "Simple Gates"

Reply With Quote
The following 2 users say Thank You to jonesr9 for this post:
 
  #3 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


hi,
here is something that direction a asked a while ago - maybe useful to know :

pivate DataSeries vs. double - NinjaTrader Support Forum

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.

max-td
Reply With Quote
The following 2 users say Thank You to max-td for this post:
 
  #4 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

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

Reply With Quote
 
  #5 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 received

Saroj,

Bool = one of two choices

0 or 1
on or off
true or false
etc.

double = any decimal number.

Reply With Quote
 
  #6 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

thanks RJay... yes I understand what boolean is... trying to better understand when to use as a variable as opposed to a BoolSeries...

Reply With Quote
 
  #7 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

it is simple
for example you look on each bar if it is a new hh or ll

if true add to bool series
if false add to bool series

wh

Reply With Quote
 
  #8 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

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...

Reply With Quote
 
  #9 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 received

Saroj,

Is this what you wanted to know...


Use a simple variable for calculations only needed right now.

Use a series if you are going to need this data in future calculations.

RJay

Reply With Quote
The following user says Thank You to RJay for this post:
 
  #10 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received


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.

Reply With Quote

Reply



futures io > > > > > When to use BoolSeries rather than simple variable

« Help! | ADX »
Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a 64bit Global Variable replacement? Tarkus11 NinjaTrader Programming 4 March 16th, 2011 08:47 AM
How can I store the first order limit price as a variable to use for calculating... richw NinjaTrader Programming 2 February 22nd, 2011 03:58 PM
Variable Range Bars aligator NinjaTrader 9 December 20th, 2010 02:20 PM
Indicator with variable Text on Chart Henrik EasyLanguage Programming 6 May 14th, 2010 02:01 PM
Variable Bar Chart DavidHP Traders Hideout 0 December 4th, 2009 04:53 PM


All times are GMT -4. The time now is 06:32 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-14 in 0.11 seconds with 19 queries on phoenix via your IP 54.226.227.175