Registered User Joined: 5/20/2006 Posts: 101
|
if you have a for next loop that outputs a date and T/F, is there a way to determine or test the value on that date? for instance, if on a date... say inputdate(i).. if that value has been assigned a value = true then do not change it to false maybe on a second pass. I understand there is a bug and all dates need to have a value of false( no skipping) I think my code overwrites true dates to false dates and I want to check the value assignment before changing it to false.
Thanks
|
Administration
Joined: 9/18/2004 Posts: 3,522
|
I'm not exactly sure I understand your question. You should only ever call AddToOutput once for a date
Ken Gilb (Kuf) Chief Software Engineer - Worden Brothers Inc. Try/Catch - My RealCode Blog
|
Registered User Joined: 5/20/2006 Posts: 101
|
what you said is what I am trying to avoid. You mentioned that there is a bug in the program and that until it's fixed, any code needs to output false on ever occurance that is not true(no skipping). So, What I am trying to do is look for a pattern (RBR from another thread which I think you are familiar with) and when the pattern is found look for when price returns to that base area for the first time..that is the buy..
You developed the "candlestick long" block a few weeks ago which conceptually did what I wanted..To refresh you..it just looked for some price...$50(that was the pattern) and the buypoint was the first and only time the price = $55(the return to the "base") but I have been unable to manipulate it to do what I ultimately need.
So...Instead, I tried another approach using nested For next loops. The outer one scrolls thru the data looking for a pattern... if it is found, the inner loop looks for a buy point and if it finds one it outputs true...great!! and if it does not it outputs false but eventually the outer loop scrolling thru looking for patterns meets up with that buypoint and if a pattern is not found or a buypoint is not found it tries to mark it as false..erasing the buy point...so, I wanted to test it before assigning a false to it..
what I came up with is:
If InputValue(i) = True Theh AddToOutput(InputDate(i),True) Else AddToOutput(InputDate(i),False) End If
But even though it seems to work, it is not exactly what I need. The code for defining the RBR is on another thread. So, until the fix is in place for this bug, Can you incorporate my definition of the rally base rally into your candlestick long blockcode?
|