Announcement

Collapse
No announcement yet.

Strategy.setStop??

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

  • Strategy.setStop??

    Hi All,

    Could someone please explain how I can use the the Strategy.setstop() command in the EFS wizard?

    I am trying to enter a position and set a stop 50 pips below the entry.

    So my approach is if I am in a trade and I am long (== true), then the following should happen Strategy.setStop(-0.0050) (this is for EUR/USD).

    Also when entering limit order how do I use it in the wizard?


    Thanks
    Harry

  • #2
    Harry
    In the following image you can see an example of how to use Strategy.SetStop() when entering a trade.



    With regards to Strategy.LIMIT you can see an example in the two images enclosed below.
    In the first one I check to make sure that the bar actually opened above the MA hence making sure that the Limit price is actually breached. Then if the Low of the bar is below I use the MA as the Limit price.
    If instead the Open of the bar is below the average I set the exit of the trade on the Open (Set3 in the second image).
    Alex



    Comment


    • #3
      Thanks Alex,

      How would I structure the syntax if I wanted the stop to be equal to a vEMA40 from the previous bar?

      I have tried the following but it scews my results to zero.

      If Long
      Strategy.setStop(low()=vEMA40.getValue(MAStudy.MA)

      If Short
      Strategy.setStop(high()=vEMA40.getValue(MAStudy.MA )

      Where would I refer the syntax to look for the previous bars vEMA40 in the syntax?

      Thanks
      Harry

      Comment


      • #4
        Harry
        You would use the bar index parameter to retrieve past values ie vEMA40.getValue(MAStudy.MA,-barIndex) where barIndex represents the number of bars back (-1 is the prior bar, -2 is two bars back, etc)
        Alex

        Comment

        Working...
        X