Program a delay or wait

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #46353 quote
    DonMasserDonMasser
    Participant
    New

    Would anyone know how to program a ‘WAIT’ into code in for  automated trading. In other words, in auto trading I have code that says buy or sell when one MA crosses over another.

    However when that happens I want to wait until my DEMA has changed direction as well.
    Any idea how to write code to ‘wait’ for a number of indicators to happen over a 5 minuteperiod while in the 1 minute timeframe before buying or selling. Appreciate in advance any help

    #46355 quote
    DespairDespair
    Blocked
    Master

    Just save the first condition in a variable and check for the second condition to be met during the next 5 bars. Is it met, you buy, if not you start the process again waiting for the first condition.

    #46391 quote
    DonMasserDonMasser
    Participant
    New

    Thanks for that… Im new but getting the swing of it……

    #97970 quote
    jamesfjamesf
    Participant
    New

    Hi

    Did you ever get to see an example of how to implement this?

    regards

    James

    #97981 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    When your condition is met, just look back n bars to detect any crossing.

Viewing 5 posts - 1 through 5 (of 5 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

Program a delay or wait


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
DonMasser @donmasser Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by robertogozzirobertogozzi
7 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/16/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...