Announcement

Collapse
No announcement yet.

Stop Loss in EFS Wizard

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

  • Stop Loss in EFS Wizard

    I am fairly new to the efs wizard and I am trying find a way of using the "Strategy.setStop" function. Currently I use the function whenever I open a position or "doLong." In the formula wizard I use the code: "Strategy.setStop(low()-1)"

    This will set a stop loss at one point below the periods close. My problem is that I track a number of securities at prices from 1 to 100. So if I want to set my stop at say 1% below my strike price, I need to calculate that amount and update the formula.

    My quesiton: is there a way to set a stop as a percentage rather than a value. I would like to set a stop a 1% below the previous periods low.

    Sorry for the long post, any help would be greatly appreciated!!

    LB

  • #2
    I have successfully written just 1 EFS with the Wizard, so keep that in mind, but it seems logical that the (1% of previous Low) stop for your Longs would be

    Strategy.setStop(low(-1)*0.99) in the "first time only" section.


    If that works, then the corresponding (1% of previous High) stop for your Shorts would be

    Strategy.setStop(high(-1)*1.01)

    Comment

    Working...
    X