2 or more time windows for orders

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #70393 quote
    AlgoAlexAlgoAlex
    Participant
    Master

    I normally use this code to set an intraday windows for opening new orders in proorder:

    noEntryBeforeTime             = 091500
    timeEnterBefore = time >= noEntryBeforeTime
    noEntryAfterTime              = 170000
    timeEnterAfter = time < noEntryAfterTime
    
    if my conditions 
    AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry then
    buy 1 contract at market

    But I wonder if is it possible to set two or more windows, for example one on London opening and one on NY opening.

    Do you have solutions?

    #70405 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can add as many as you wish, just add different variable names, such as

    timeEnterBefore1 = time >= 091500
    timeEnterAfter1  = time < 123000    //pause at lunchtime
    timeEnterBefore2 = time >= 143000   //start again
    timeEnterAfter2  = time < 170000
     
    if my condition AND ((timeEnterBefore1 AND timeEnterAfter1) or (timeEnterBefore2 AND timeEnterAfter2)) AND not daysForbiddenEntry then
       buy 1 contract at market
    endif
    AlgoAlex thanked this post
    #70471 quote
    AlgoAlexAlgoAlex
    Participant
    Master

    Thanks, so simply after all!

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

2 or more time windows for orders


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
AlgoAlex @alexf Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by AlgoAlexAlgoAlex
8 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/14/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...