How do I buy after 30 seconds from an event?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #54729 quote
    ReviRevi
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    ReviRevi
    Participant
    New

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

    #54767 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
8 years, 9 months ago.

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