Dukascopy
 
 
Wiki JStore Search Login

boolean assignment
 Post subject: boolean assignment Post rating: 0   New post Posted: Thu 30 Jun, 2016, 13:44 
User avatar

User rating: 1
Joined: Thu 23 Jun, 2016, 11:36
Posts: 45
Location: AustriaAustria
Hi, I need to fully understand the boolean assignment block. If I want to assign true to a variable "Candle_Down", I would make the first parameter (assigned value) as "true" and the second parameter (assigned variable) I would label "Candle_Down". But why is there a requirement to create a true or false start-value as well for the "Candle Down" assigned variable. I'm not a java programmer, but it looks like some kind of field initialization. So I guess that I initialize the Candle_Down assigned variable to false in this case (I can't see the point in making it true if the value to be assigned is also true).

Am I right about all this? And is there any useful situation in which the assigned boolean value in the first parameter could be same as the boolen value for the assigned value (2nd parameter)?
thanks


 
 Post subject: Re: boolean assignment Post rating: 0   New post Posted: Thu 30 Jun, 2016, 13:59 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Quote:
If I want to assign true to a variable "Candle_Down", I would make the first parameter (assigned value) as "true" and the second parameter (assigned variable) I would label "Candle_Down"


The above is right.
Any variable has to have a start value whether it is used for calculation or for logical operation such as Boolean type.
In this case, I understand your point but you have to think this way: Variable A = True by default, and if X, Y, Z conditions are met then it switch to False. You can reverse the logic if you which and start with false then turn it to true if conditions are met.
In the example that you described you should start with False so that it is turned to true afterwards.

Quote:
And is there any useful situation in which the assigned boolean value in the first parameter could be same as the boolen value for the assigned value (2nd parameter)?
thanks

Yes there is some situations where the default value of the variable (say True) is used in conditions IF=True as well. Such condition depends on the situations. There should be some examples from my previous posts in this forum where you can find such kinematics.

Cheers


 
 Post subject: Re: boolean assignment Post rating: 0   New post Posted: Thu 30 Jun, 2016, 14:09 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Attached a quick example..


Attachments:
BooleanLogicExample.vfs [22.03 KiB]
Downloaded 152 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: boolean assignment Post rating: 0   New post Posted: Thu 30 Jun, 2016, 15:39 
User avatar

User rating: 1
Joined: Thu 23 Jun, 2016, 11:36
Posts: 45
Location: AustriaAustria
thanks - I get it now.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com