Larry Connors High Probability ETF Trading
Author: jandrewnil
Creation Date: 12/21/2009 5:32 PM
profile picture

jandrewnil

#1
I am new to C# and have not programed in years. Please review code and make suggestions to make it better. One question is how would you code the aggressive position (see comments in code).

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

Cone

#2
1. You've used a lot of boolean "&". If you don't actually need all the conditions to be evaluated (you don't), use "&&".
2. Look up the CumUp and CumDown indicators to simplify. For example, your entry rules can be simplified to:

CODE:
Please log in to see this code.


As for the agressiveness, that changes things more than you might think. The logic is written for a single Position and the entry and exit logic are mutually exclusive. When you start dealing with multiple positions, you shouldn't generally use "LastPosition" logic. Look up scripts that use ActivePositions.Count in the code, or, use the Strategy Builder with the Multi-Position option selected for exambples.
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).