Why No Shorts in a SAR System?
Author: marty n
Creation Date: 3/26/2009 1:32 AM
profile picture

marty n

#1
Can someone tell me what this sample script needs in order to generate short trades. When the price crosses below the MA, a sell (of the long position) occurs , but not the reversal to a short.

Thank you.

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

Eugene

#2
1) Please use the CODE tags when you post code.
2) FYI, here's an article to help code systems that reverse from long to short:
WealthScript Techniques | Creating a Stop-And-Reverse (SAR) system

Code above will not work because the very first trade should be processed individually by checking for Positions.Count == 0. Here's the corrected code:
CODE:
Please log in to see this code.
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).