Trade time code.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11709 quote
    Elsborgtrading
    Participant
    Veteran

    Hi guys.

    I think I did backtest this code with success, but it seems like when Live trading a position was executed this morning at 5:00. It should be straight forward but apparently it’s not?

    I cannot see what is wrong?

    Cheers Kasper

    DEFPARAM CumulateOrders = true
    IF (Time >= 08000 AND Time <= 220000)then
    Tradetime=1
    else
    Tradetime=0
    endif
    
    IF Not LONGONMARKET AND longcondition and tradetime THEN
    BUY PositionSize CONTRACT AT MARKET
    ENDIF
    
    // short
    IF Not SHORTONMARKET AND shortCondition and tradetime THEN
    SELLSHORT PositionSize CONTRACT AT MARKET
    ENDIF
    #11710 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    I’d say there is a missing zero,

    Time >= 08000

    vs

    Time >= 080000
    #11712 quote
    Elsborgtrading
    Participant
    Veteran

    yes you are so right.. I’m such a noob.. Thanks anyway 🙂

    Cheers Kasper

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

Trade time code.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Elsborgtrading
9 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/15/2016
Status: Active
Attachments: No files
Logo Logo
Loading...