sell signal at a specified percentatge below SMA
Author: jahlbeck
Creation Date: 3/24/2010 1:14 PM
profile picture

jahlbeck

#1
The code below from Strategy Builder. This code buys at SMA and sells below SMA.

How would I change the code to indicate a sell signal at a specified percentatge below SMA?

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

Eugene

#2
When posting code, please wrap it between a pair of CODE tags. Thanks. The CODE button is right above the message text box: Bold, Italic, ... CODE, IMG. I've made the change for you.

Regarding your question.

1. You could use the "Price is <(>) X% above(below) Indicator" rule.
2. Or, the MA in this snippet:
CODE:
Please log in to see this code.
could be modified, for instance, like this:
CODE:
Please log in to see this code.

To make the percentage choice interactive for rule-/code-based strategies, see the User Guide on exposing Strategy parameters and the Programming Guide on Programming Trading Strategies > Strategy Parameters, respectively.
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).