Trade FOREX with FXCM

  • Award-Winning Platform
  • 24/7 Customer Support
  • Trade Directly on Charts
  • Free $50K Practice Account

Results 1 to 2 of 2
  1. #1
    mitenp is offline Member
    Join Date
    Feb 2011

    Executing at trigger price when backtesting


    I wrote a EA and tried to backtest it. Found that the trades were always being exeuted at the close of the bar rather than the trigger price. I was using Market order. (Ea.jpg and BK.fxd)

    When I changed the order to stops then it looks like they are getting executed at the trigger price (EA_StopBased.jpg and BK_StopBased.fxd)

    Can someone advise whether the second method is the correct method or am I thinking its working correctly for the wrong reasons. Want to properly test prior to engaging the EA

    รูปขนาดเล็ก รูปขนาดเล็ก Executing at trigger price when backtesting-ea.jpg  

    Executing at trigger price when backtesting-ea_stopbased.jpg  

    ไฟล์แนบข้อความ ไฟล์แนบข้อความ

  2. #2
    Carl A is offline FXCM Automated Platform Specialist
    Join Date
    Oct 2010
    Hi mitenp,

    In backtesting, Market orders (IMarketOrder) are executed at the close of the bar, unless you enabled intra-bar order generation. Entry orders (IPriceOrder) on the other hand are always executed on the trigger price. There's nothing wrong with your results.

    Best Regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Disclaimer: Trading foreign exchange on margin carries a high level of risk and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. The possibility exists that you could sustain a loss in excess to your investment and therefore you should not invest money that you cannot afford to lose. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. You should be aware of all the risks associated with foreign exchange trading and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. FXCM will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.