Trade time code.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11709 quote
    ElsborgtradingElsborgtrading
    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_BywanJC_Bywan
    Moderator
    Master

    Hi,

    I’d say there is a missing zero,

    Time >= 08000

    vs

    Time >= 080000
    #11712 quote
    ElsborgtradingElsborgtrading
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Trade time code.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by ElsborgtradingElsborgtrading
10 years, 2 months ago.

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