How do I buy after 30 seconds from an event?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #54729 quote
    Revi
    Participant
    New

    It’s my first post. I’ve played a bit with was shown on the video tutorial and now I’d like to buy after 30 seconds from an event. How can I achieve this task?

    The event is a green candlestick.

    Can you help me or suggest what to read?

    #54744 quote
    robertogozzi
    Moderator
    Master

    Strategies are executed when a bar closes, so to be sure you enter after 30 seconds you have to launch your strategy in 30-second timeframe and, when the event occurs set a avariable of your choice and, based on that info, enter the next candle. Roberto

    #54752 quote
    Revi
    Participant
    New

    Thanks for the answer. How do I recognize a candle has started / closed? 

    #54767 quote
    robertogozzi
    Moderator
    Master

    It’s straigthforward. Simply:

    IF close > ..... THEN    //close ALWAYS refers to the currently closed bar/candlestick
    
    ENDIF
    //
    IF close[1] > ..... THEN  //close[1] refers to the previously closed bar/candlestick
    
    ENDIF

    You have to use a number within brackets to refer to some bar in the past, [0] can be omitted and refers to the currently closed bar/candlestick.

    The bar/candlestick that is being opened and which is the bar/candlestick when your trade is entered cannot be referred to until it is closed.

    Roberto

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

How do I buy after 30 seconds from an event?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Revi @revi Participant
Summary

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

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