Announcement

Collapse
No announcement yet.

Strategy stuff

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

  • Strategy stuff

    Guys,

    I'm looking to back-test some formula stuff and looking there fore to use the strategy object. Got it working and getting some reasoanble results but I want to reflect them on a chart as well. I'm using the basic Strategy.doLong and Strategy.doShort calls but I was wondering if in the object there is the price that they are realistically filled at. I've got some images drawn on the chart but they seem to not always accurately reflect the entry and exit.

    I'm always using the Strategy.MARKET and Strategy.THISBAR settings so can I use the current close() as a reference or is there a way to get the actual values?

    TIA

  • #2
    Hello Rich,

    Strategy.MARKET / Strategy.THISBAR will use the open of the bar, which isn't a realistic price for entries if your strategy conditions are based on the high, low or close of the bar. I would recommend using Strategy.MARKET / Strategy.NEXTBAR, which would use the open of the next bar. Alternatively, you could use Strategy.LIMIT / Strategy.THISBAR and specify the exact price that you want to use for the entry or exit price. You'll need to incorporate a little more code to determine that price, but this will allow you to get a more realistic price as if you were analyzing intra-bar data.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      strategy entries and graphics..

      regarding the entries, use the best entry method you can find to reasonably equate a decent entry price level. Then use the slippage feature to allocate an amount (just in case the entries are off a bit). If your system still shows profits, then great..

      Regarding the graphics.....

      I normally have my code draw arrows when it ENTERS or REVERSES a trade (green and red).

      Then, I normally draw BLUE arrows (in the opposite direction of the trade) showing where profit targets are hit.

      I also draw MAGENTA arrows (in the opposite direction of the trade) showing where STOPS were hit..

      Next, I draw DIAMONDS for the profit targets and stops..
      Blue for profit targets
      Red for stop levels.

      This normally gives me enough visible information to use the system.

      Best regards,

      Brad
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        Damn... Thanks for your feedback guys, first time I've really tried the strategy stuff and thought I had a winner. Need to cancel the yatch before the office closes.... Oh well.

        Comment

        Working...
        X