the trailing stop will never be executed, as the last two lines are concurrent types of stop loss and, being the code read and executed sequentially, the last line will always override the previous one.
Your second snippet:
1
2
3
IflongonmarketANDtrailingstopTHEN// Active TrailingStop
Buy1Contract....// Position Size Increasing
ENDIF
has THEN misplaced in the line after IF, while it must be the last keyword in the same line as IF (comments aside). Anyway, the code seems correct, provided you have assigned trailingstop a value other than 0, based on a trailing stop snippet you have placed somewhere in your code.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue