Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

code question Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
JDiStefano
Posted : Monday, January 1, 2007 12:13:06 PM
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
Kuf
Posted : Monday, January 1, 2007 7:58:42 PM


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
JDiStefano
Posted : Monday, January 1, 2007 11:36:40 PM
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?

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.