| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Adding Lower TF NON-NB Trading to Baluda's MultiBob https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=852 |
Page 1 of 1 |
| Author: | gaheitman [ Sat Sep 29, 2012 2:17 pm ] |
| Post subject: | Re: Adding Lower TF NON-NB Trading to Baluda's MultiBob |
Don't forget to update VALUESCOUNT to cover your new data values. It determines the size of the array used to store the values for all the currencies. It needs to be 82 now, unless you've added more items. Actually, you've left a "hole" at value 59. Your added indexes should start at 60 and VALUESCOUNT would then be one more than the highest index you add (so really it would be 81). George |
|
| Author: | NeoTrader [ Sat Sep 29, 2012 3:20 pm ] |
| Post subject: | Re: Adding Lower TF NON-NB Trading to Baluda's MultiBob |
Hi dancingphil, The #define is used in most cases to declare constant names with constant numeric values so you don't have to juggle (and remember) the different numeric values... eg. #define up 0 // "Up. " #define down 1 // "Down. " #define none 2 // "None. " It is easier to remember the constant names "up", "down" and "none" instead the represented numeric values 0, 1 and 2. if you now use the constant "up" in your code it is automatically replaced by it's value (in this case 0) hope that this helps a little bit, happy weekend, NeoTrader - |
|
| Author: | gaheitman [ Sat Sep 29, 2012 4:50 pm ] |
| Post subject: | Re: Adding Lower TF NON-NB Trading to Baluda's MultiBob |
The numbers just need to be different within a group of items you are comparing. For example, if you defined different fruits like this: //apples #define red_delicious 0 #define granny_smith 1 #define fuij 2 //oranges #define navel 0 #define blood 1 #define valencia 2 We can now test to see whether apple == fuji. The numbers within each group do not matter, as long as they are different. We know if isn't an orange, because our code doesn't need to differentiate between apples and oranges, it always knows which kind we have. Now, if your code doesn't know that it has an apple, you would need to number them sequentially so that you could test to see what you had. //apples #define red_delicious 0 #define granny_smith 1 #define fuji 2 //oranges #define navel 3 #define blood 4 #define valencia 5 Now, if fruit >= 3, we know it is an orange. These numbers are arbitrary, the numbers for the indexes need to be sequential, since they are used to identify a position within an array. The names are used for readability. George |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|