Announcement

Collapse
No announcement yet.

Help with Strategy code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Strategy code

    Can anyone help me with the following code:

    'Enter trade if share price is X% above/below the high/low of the day before'

    I guess it would look something like this

    if (share price>previous day's high by X%) Strategy.doLong

    Thanks.

  • #2
    johntherevelato
    You could use something similar to what is shown below. The example assumes 5%
    Alex

    PHP Code:
    var vPercent 5;

    if(
    close(0)>high(-1,inv("D"))*(1+(vPercent/100))){
        
    Strategy.doLong(fill in your parameters here);

    Comment

    Working...
    X