Hi,
I have a simple long/short reversal system with 3xATR stops.
When a position has been stopped out, I would like to add an order to reenter the trade at the original price, in the original direction with a 3xATR stop. If price reaches the original entry price, I would like a new trade to be triggered. If, however, a new trade is entered in the opposite direction, I would like the order to be cancelled. Is that something you could help me with?
Many thanks
CODE:
Please log in to see this code.
Size:
Color:
Hi,
Here's sample code of a simple long-only system to make a reentry on your conditions. Didn't have time to test it too much though. Reentry for a SAR type of system would be less intuitive and harder to manage so I'm not going to approach this.
Note that your draft code should not be used due to various errors (from syntax to peeking into the future).
CODE:
Please log in to see this code.
Size:
Color:
Size:
Color:
Hi Eugene,
Thanks for your help. It sounds like what I'm trying to do is quite difficult. I'll see what I can do.
Regarding your comment:
"Note that your draft code should not be used due to various errors (from syntax to peeking into the future)."
I've gone over the code and cannot see where the problems lie. Can you be more specific? I'm looking to open/close trades in the last 10 mins of the session when there is a cross over (which is of course not confirmed until the close). Is this what you mean by peeking into the future?
And regarding syntax errors, my limited experience is not letting me see them. Can you be more specific?
Cheers
Size:
Color:
1. Missing braces here (and more):
CODE:
Please log in to see this code.
The resulting signals will not make sense even if you fix this - it's more than a simple fix.
2. Peeking into the future with bar+0 for anything but AtClose:
CODE:
Please log in to see this code.
Suggestion: break your system into two (long and short) strategies so that it would be easier for you to code.
Size:
Color:
Good idea. Thanks Eugene.
Size:
Color:
Glad to help you Paul. Let me know if further coding advice or review is required.
Size:
Color: