Coppergate Oscillator Pullback
Author: fubar
Creation Date: 4/2/2010 10:09 AM
profile picture

fubar

#1
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.
profile picture

Eugene

#2
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.
profile picture

fubar

#3
Thanks Eugene...very helpful. Do you have any insights on #1?
profile picture

Cone

#4
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.)
profile picture

Eugene

#5
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.
profile picture

fubar

#6
Thanks Cone. Here's the full script...

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

Eugene

#7
Here's my take at it:
CODE:
Please log in to see this code.
profile picture

fubar

#8
Thanks Eugene!
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).