Help with Bool in indicator. - NinjaTrader Programming | futures io social day trading
futures io futures trading


Help with Bool in indicator.
Updated: Views / Replies:463 / 8
Created: by kidvic 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
 

Help with Bool in indicator.

  #1 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received

Help with Bool in indicator.

Can a bool have too many conditions where the script just won't work?

for example.
somecondition will always be different.

bool C1 = "somecondition" && "somecondition";

all the way up too..... '

bool C48 = "somecondition" && "someconditions" && "somecondition" && "somecondition" && "somecondition" && "somecondition" && somecondition" && "somecondition;


I'm able to have C1 - C3 work, but after C4, my script doesn't draw the plot anymore, as if the script just doesn't work anymore.
All logic is valid, as there are no errors. At this point these are just bools, and the plot isn't actually tied to the conditions of the bools so I'm confused.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Sarasota FL
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Chart
Favorite Futures: ES
 
Posts: 3,636 since Jan 2013
Thanks: 26,761 given, 11,119 received
Forum Reputation: Legendary



kidvic View Post
Can a bool have too many conditions where the script just won't work?

for example.
somecondition will always be different.

bool C1 = "somecondition" && "somecondition";

all the way up too..... '

bool C48 = "somecondition" && "someconditions" && "somecondition" && "somecondition" && "somecondition" && "somecondition" && somecondition" && "somecondition;


I'm able to have C1 - C3 work, but after C4, my script doesn't draw the plot anymore, as if the script just doesn't work anymore.
All logic is valid, as there are no errors. At this point these are just bools, and the plot isn't actually tied to the conditions of the bools so I'm confused.

Your problem isn't because you have 4 bools, or however many you have there.

Without the full code, it's not going to be possible to find the error.

(BTW, the fact that there are no compile errors, if that's what you meant, does not mean that the logic is valid. I have a lot of experience with writing code that compiles, and runs with no errors, but that just is wrong.... )

If you can post the code and a description of what it does, someone can help.

Bob.

Reply With Quote
 
  #4 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received


bobwest View Post
Your problem isn't because you have 4 bools, or however many you have there.

Without the full code, it's not going to be possible to find the error.

(BTW, the fact that there are no compile errors, if that's what you meant, does not mean that the logic is valid. I have a lot of experience with writing code that compiles, and runs with no errors, but that just is wrong.... )

If you can post the code and a description of what it does, someone can help.

Bob.

I just added one more condition to the last bool, and like I said, the plot is not tied to these bools.
So why would that even make a difference.

Reply With Quote
 
  #5 (permalink)
Market Wizard
Sarasota FL
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Chart
Favorite Futures: ES
 
Posts: 3,636 since Jan 2013
Thanks: 26,761 given, 11,119 received
Forum Reputation: Legendary


kidvic View Post
I just added one more condition to the last bool, and like I said, the plot is not tied to these bools.
So why would that even make a difference.

Again, this kind of question cannot be answered without seeing the rest of the code, or at least enough to understand what is going on.

For what it's worth, C# does not have any restriction on the number of boolean conditions you use, so the solution is likely in something else.

But, without being able to see what the code is doing, it is hard to help.

There are many good programmers here who will try to help, but without the code, just dealing with general questions like this makes it impossible to answer.

I will help if I am able, but you need to make it possible to get the help. I am sure someone else would also pitch in.

Your choice.

Bob.

Reply With Quote
 
  #6 (permalink)
3rd times a charm!
San Francisco CA
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: CQG
Favorite Futures: ES
 
Zxeses's Avatar
 
Posts: 139 since Jun 2014
Thanks: 90 given, 171 received


kidvic View Post
Can a bool have too many conditions where the script just won't work?

for example.
somecondition will always be different.

bool C1 = "somecondition" && "somecondition";

all the way up too..... '

bool C48 = "somecondition" && "someconditions" && "somecondition" && "somecondition" && "somecondition" && "somecondition" && somecondition" && "somecondition;


I'm able to have C1 - C3 work, but after C4, my script doesn't draw the plot anymore, as if the script just doesn't work anymore.
All logic is valid, as there are no errors. At this point these are just bools, and the plot isn't actually tied to the conditions of the bools so I'm confused.

Each condition returns its own bool, either a 1 true or a zero false. Any one condition in your example can set the resultant total bool to false unless ALL the conditions are met, take these for understanding:

Bool myResultbool = true && true && true && false
myResultbool = false

All it takes is one false to make the result bool false. The reverse of this gives the reverse result:

Bool myResultbool = false || false || false || true
myResultbool = true

Make sense?

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Nelson, New Zealand
 
Futures Experience: Advanced
Platform: NinjaTrader, RCG
Broker/Data: Rosenthal, Collins Group/ Continuum
Favorite Futures: Hang Seng at the moment.
 
ctnz's Avatar
 
Posts: 35 since Jan 2012
Thanks: 2 given, 91 received

Zxeses

You can use nested if's

For example
bool C48 = false;
if (somecondition" && "someconditions" && "somecondition" )
{
if (somecondition2" && "someconditions3" && "somecondition4" )
{
C48 = true;
}
}

But reading between the lines if you have that many conditions you are curve fitting to historical data trying to find rare conditions or some magic combination of indicator values that will rarely be met or repeated hoping for a high win percentage. The simplest methods are the most robust and flexible. Also I would guess you are looking at oscillators which at best tell you what just happened and are no more effective at telling the future than a dice roll. You need to find market fundamentals and use those conditions to base your decisions. Take all this as a grain of salt from someone who has been a programmer for close to 40 years, so I guess I know nothing.

Most likely you will thunder on Don Quixote until you see the futility of your ways. Most of the learning is at the end of the quest, denial dies hard, acceptance hurts.

Sorry if I sound more than a bit cynical but seen too many programmers before you bite the dust hard on the search for the holy grail. Best of luck.

Reply With Quote
 
  #8 (permalink)
3rd times a charm!
San Francisco CA
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: CQG
Favorite Futures: ES
 
Zxeses's Avatar
 
Posts: 139 since Jun 2014
Thanks: 90 given, 171 received


ctnz View Post
Zxeses

You can use nested if's

Ctnz, your post should be directed at the person asking the question, not the people trying to help him.

-Zx

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
Nelson, New Zealand
 
Futures Experience: Advanced
Platform: NinjaTrader, RCG
Broker/Data: Rosenthal, Collins Group/ Continuum
Favorite Futures: Hang Seng at the moment.
 
ctnz's Avatar
 
Posts: 35 since Jan 2012
Thanks: 2 given, 91 received

Zxeses

My extreme apologies. Major boo-boo on my part especially to someone in the Bay Area. I guess I hit the wrong reply button.

Should I re-reply or will KidVic see my post?


Last edited by ctnz; October 18th, 2015 at 01:45 AM.
Reply With Quote

Reply



futures io > > > > > Help with Bool in indicator.

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
Volmaxmultiple Indicator or Volume Multiplier Indicator? Revv NinjaTrader 1 February 15th, 2015 01:18 PM
Opening Range Indicator (w/ Indicator Input) wuileng NinjaTrader 5 January 21st, 2014 07:52 AM
bool off after a period of time toddma EasyLanguage Programming 2 March 22nd, 2013 05:41 AM
bool switch... simple.. toddma EasyLanguage Programming 37 December 12th, 2012 07:55 PM
CalculateOnBarClose as a bool or as a simulation within OnBarUpdate chapter SARdynamite NinjaTrader Programming 5 July 5th, 2010 02:02 AM


All times are GMT -4. The time now is 06:10 AM.

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-17 in 0.14 seconds with 19 queries on phoenix via your IP 54.82.81.154