Printing to PrintDebug a list of symbols that have the IsLastPositionActive from a DataSet
Author: hmg2020
Creation Date: 4/28/2010 7:58 PM
profile picture

hmg2020

#1
I need help printing to PrintDebug a list of symbols that have the IsLastPositionActive from a DataSet (foreach(string sym in DataSetSymbols)).
Here is the code that generates the IsLastPositionActive...
CODE:
Please log in to see this code.
profile picture

Eugene

#2
Considering that this code will never exit a position until "today" (AtClose) or "tomorrow" (AtMarket), add a call to PrintDebug right after your "Position p..." line:
CODE:
Please log in to see this code.
profile picture

hmg2020

#3
Thanks Eugene, placing the suggested printdebug after Position p creates a list but with the same ticker symbol...
I need to create a list foreach(string sym in DataSetSymbols) that has the position active and then print all the ticker symbols in the list..

I tried this, but its giving me errors..

CODE:
Please log in to see this code.
profile picture

Eugene

#4
Eliminate this construct: foreach(string sym in DataSetSymbols)...

Your code above didn't contain it, and my reply was based on what you show, not what's behind the scenes.
profile picture

hmg2020

#5
Eugene, let me try this again...
I need to put in a file (PrintDebug) all the ticker symbols from a DataSet that have DIP > DIM in the current bar...

CODE:
Please log in to see this code.


Ca you help me with this?

Thanks
profile picture

Eugene

#6
PrintDebug does not put something in a file.

Here's what you requested. Make sure to not put this code snippet inside another DataSetSymbols loop, in the Bars loop (or any other loop):
CODE:
Please log in to see this code.
profile picture

hmg2020

#7
It is not working for Daily Scale, and can I just put the symbols in PintDebug instead?
profile picture

Eugene

#8
QUOTE:
It is not working for Daily Scale

Of course it does. The problem is that you're not telling how exactly you're applying this correctly working code.
QUOTE:
can I just put the symbols in PintDebug instead?

Sure you can.
profile picture

hmg2020

#9
Sorry Eugene, I did not mean to offend you... I'll just drop it...Thanks for all your help
profile picture

Eugene

#10
No offense at all, trying to help but since technicians can't read minds, ambiguity/vagueness certainly are getting in the way.
profile picture

hmg2020

#11
Sorry... My Dataset id every 30-minutes..., but I want to run the code you create on a Daily scale, but it gives me a runtime error, saying that it cannot convert daily bars to 30 minute bars...
Here is the complete code.

CODE:
Please log in to see this code.
profile picture

Eugene

#12
This makes difference. Try the following:

1. Leave the native data scale (30-minute)
2. Load enough intraday bars to compute the 13-day DI+/DI-
3. Run this strategy in single symbol mode (i.e. click on any symbol, don't run in portfolio backtest mode):
CODE:
Please log in to see this code.
profile picture

hmg2020

#13
It is still including only those symbols that have DIP > DIM in the 30 min scale...
profile picture

Eugene

#14
My bad. Didn't realize I needed to access the compressed bar number. Check out the updated code above, it should work now as intended.
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).