Thanks in advance for your help...
1) Time-based exit: I'm running a strategy with 60 min bars and want to exit after 3 days. The strategy isn't exiting. Here is the code I have [_hold.ValueInt is set at 21 (7 trading hrs. x 3 days)]:
CODE:
Please log in to see this code.
2) What does the "public" classification mean? I would like my strategies to be private. How do I do this?
3) I'm backtesting against 500 symbols and it is painfully slow. Is there a faster method?
4) Not being a programmer, is this code interchangable with other platforms like NinjaTrader?
Thanks again.
Size:
Color:
QUOTE:
2) What does the "public" classification mean? I would like my strategies to be private. How do I do this?
Disregard that, it's a misconception. Actually, better take any C# 101 book/course/tutorial recommended here to find out what does public/private/internal etc. really mean: (scroll to)
How do I start with C# ?QUOTE:
4) Not being a programmer, is this code interchangable with other platforms like NinjaTrader?
No.
QUOTE:
3) I'm backtesting against 500 symbols and it is painfully slow. Is there a faster method?
Yes, disable that On Demand Data Update checkbox in Data Manager to feel the difference.
Size:
Color:
Thanks Eugene...very helpful. Do you have any insights on #1?
Size:
Color:
1) The snippet by itself looks like it would work, so the problem must be somewhere else that you're not showing us. For example, if the script trades multiple Positions, but exists the LastPosition before a previous position, your code will not be executed properly. (You shouldn't use LastPosition logic for multi-Position scripts.)
Size:
Color:
QUOTE:
Thanks Eugene...very helpful. Do you have any insights on #1?
I agree completely to what Cone says above.
Here's an illustration how to count trading days in an intraday strategy, exiting after 3 days held:
CODE:
Please log in to see this code.
Size:
Color:
Thanks Cone. Here's the full script...
CODE:
Please log in to see this code.
Size:
Color:
Here's my take at it:
CODE:
Please log in to see this code.
Size:
Color:
Thanks Eugene!
Size:
Color: