Can't get this girl(WLP 5.6) to dance like WLP 4.5
Author: tedclimo
Creation Date: 7/20/2010 2:28 PM
profile picture

tedclimo

#1
I have a simple exit code in WLP 4.5 that I cannot get to work in WLP 5.6 (no matter how many ways I've tried).
Can you please point out the error of my ways:
Here's WLP 4.5 EXIT code (that dances perfectly)
CODE:
Please log in to see this code.


Here's latest version of WLP 5.6 EXIT code(that won't dance with me)
CODE:
Please log in to see this code.


The error msg I get is "CSO136@77,13): a local variable named 'bar' cannot be declared in this scope because it would give a different meaning to 'bar', which is already used in a parent or current.... rest of msg runs off page & cannot see what it says.

Clearly, I am not allowed to use 'bar' in the secondary Exit loop. How do I fix?


Thanks in advance,
Ted
profile picture

Cone

#2
Don't fight the brackets, and when you create one, put another one right below it to finish the block. The problem is that the second loop is contained within the first. Stick with where the Editor puts the brackets for you - it's the "right" way and you won't get confused where a block starts and ends.

CODE:
Please log in to see this code.

Do both of these loops really appear in the same script?
profile picture

tedclimo

#3
My living comes from just 3 WLP 4.5 scripts (All girls who ere wonderful dancing partners). Yet all my efforts to create WLP 5.6 equivalents result in errors.

All 3 are very private, so assume I need to seek your counsel on 'Order Ticket', one at a time.

First one, you were helping me with in February: You helped me build a 4.5 version of a daytrader that rotates b/t FAS / FAZ... now I need it in 5.6. You went on vacation & we never made the transition. I have been paper trading it ever since & it is up some 27% YTD by placing one trade (20% capital) every couple days on trades that last roughly 4-6 hrs..... /Forum/Posts/Simple-intraday-script-with-two-position-mgmt-problems-30317#150033

Second one is partially shared in the posting above: I appreciate the advice you gave me on 'bracket mgmt', but your solution also resulted in more error msgs..... Only thing I can figure is that the rest of my code somehow creates a problem that you could not possibly foresee. Only way to deal with this is to share entire code (both 4.5 & 5.6). But I want to work on it myself for a lttle while longer, to try & solve it on my own.

Third one, I am still trying to solve.

Point is, please be patient if you see several order tickets come in (from me) before the 8/4/10 death of WLP 4.5.

Am doing my best to get 5.6 to dance.... in the meantime.

All the best to you & yours,
Ted
profile picture

tedclimo

#4
Woo Hoo!
Robert, you were absolutely 'on the money' !!!
I owe you an apology. Your wisdom was dead on. I simply applied your code incorrectly.
Bracket Mgmt was my 'Achilles heel' in that script.

The #2 lady(5.6) I referenced in email above is now waltzing like Jamie Lee Curtis in the movie "True Lies".

Thank you!!!

The #3 lady I referenced above --- Am pretty sure I can make the 4.5 to 5.6 conversion(without to much assistance).

Will still need help with the #1 lady (referenced above), the FAS/FAZ daytrader. She's a tough cookie. I believe she's the last code I'll need your help with. Am sending her to order ticket

Robert, IN YOUR LAST POST, you asked me the following question:
QUOTE:
Do both of these loops really appear in the same script?

My answer is yes, but if you can recommend a more efficient method for combining both exits into one loop, then I am all ears.
To be completely accurate, this is how they look right now, & they work perfectly:
CODE:
Please log in to see this code.


Your biggest fan,
Ted
profile picture

Cone

#5
It's hard for me to see how 2 bar loops for different exits fit into a single script (I'd never write a script that way), so if it "works" for you and still pays the bills, that's fine with me!
profile picture

tedclimo

#6
Robert,
Please show me how you would construct those same two exits into a single loop.

I have tried numerous alternatives, but could never get the same results as just using separate loops.

It's pure habit for me to create separate loops for entries &/or exits (that have different prerequisite conditions).

But I am always interested in coding more efficiently.

profile picture

Cone

#7
There you go, messing up the brackets already...

Anyway, code is precise. Context matters. I can put 2 statements together just as easy as anyone else, but if its not in the right context, you won't get the results you're looking for. It seems like your using the AtClose orders to clean up positions or sell at the end of the day, or something else. The context is not apparent and would have to be integrated properly in a script logically.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).