Program a delay or wait

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #46353 quote
    DonMasser
    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
    Despair
    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
    DonMasser
    Participant
    New

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

    #97970 quote
    jamesf
    Participant
    New

    Hi

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

    regards

    James

    #97981 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
6 years, 9 months ago.

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