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.
Size:
Color:
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.
Size:
Color:
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.
Size:
Color:
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.
Size:
Color:
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
Size:
Color:
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.
Size:
Color:
It is not working for Daily Scale, and can I just put the symbols in PintDebug instead?
Size:
Color:
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.
Size:
Color:
Sorry Eugene, I did not mean to offend you... I'll just drop it...Thanks for all your help
Size:
Color:
No offense at all, trying to help but since technicians can't read minds, ambiguity/vagueness certainly are getting in the way.
Size:
Color:
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.
Size:
Color:
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.
Size:
Color:
It is still including only those symbols that have DIP > DIM in the 30 min scale...
Size:
Color:
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.
Size:
Color: