Announcement

Collapse
No announcement yet.

Strategy to buy/sell on stop/limit

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

  • Strategy to buy/sell on stop/limit

    Hi,

    I am looking to write an EFS that will transaction a strategy whenever a particular stop/limit order is reached. From the back testing efs which shipped with eSignal - I see how the strategy uses the Market, a proxy for the Open price of a particular bar, to see if it will take the order. How do I change this so that anytime the bar crosses my pt, the strategy will be acted upon?

    Example - I want to doLong every time the price crosses the 50 bar moving average from the bottom and doShort anytime the price crosses from the top.

    The second part of the problem -- what about indicators that are not built in and I have to save the previous bar's value in a variable in order to do the comparison to see which direction I am approaching from.

  • #2
    dbTrader
    With regards to the second question you can use the ref() function.
    For more information or some examples on this function see Function Reference in the EFS Help Center and Library
    Alex

    Comment


    • #3
      dbTrader
      With regards to the first question you can use Strategy.LIMIT using the MA as the value at which the trade will be entered.
      Using Limit should also ensure that the entry price has actually been traded.
      Attached is an efs (for backtesting purposes) that will implement the example you mentioned. It was created using only the Formula Wizard.
      Hope this helps
      Alex
      Attached Files

      Comment

      Working...
      X