Why the backtest result is different with real trading?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25754 quote
    manson4134
    Participant
    New

    Hi all:

    I am a client of IG, recently I wrote my own strategy and backtest, then put on-line

    but today it shows sth. odd…

    For forex CAD/JPY today (20/FEB) it shouldn’t have any trade at 01:00 bar by backtest,

    but in real auto-trading it sells 1 contract @86.128, and finally get stoploss

    does any one know why? Is that an bug?

    I attach code here, DSTU_RSI is my own indicator:

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter short positions
    indicator1, ignored = CALL "DSTU_RSI"(close)
    indicator2 = Stochastic[14,3](close)
    indicator3 = Average[3](indicator2)
    c1 = (indicator1 < 0)
    c4 = (indicator2>70)
    
    IF c1 and c4 THEN
    SellP=Low-3*pipsize
    else
    SellP=2*close
    ENDIF
    IF close>SellP then
    SELLSHORT 1 CONTRACT AT SellP stop
    endif
    
    
    c2 = (indicator2 >= indicator3)
    c3 = (indicator2 < 70)
    c6 = abs(close-TRADEPRICE(1))>=10*pipsize
    IF c2 AND c3 AND c6 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pLOSS 30
    圖片3.jpg 圖片3.jpg
    #25801 quote
    Eric
    Participant
    Master

    have you checked the spread at the time of the order?

    when using stop to open position its the bid and ask that do the job

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Why the backtest result is different with real trading?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
manson4134 @manson4134 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Eric
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/20/2017
Status: Active
Attachments: No files
Logo Logo
Loading...