How to Force DOpen value of a specific time

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10958 quote
    algotraderalgotrader
    Participant
    Average

    Hello Traders

    South Africa trade starts at 083000
    I’d like to use the ‘Open’ at that specific time as a parameter within my code.
    (Much like the DOpen, Kind of creating my own DOpen)

    How do I do that?

    Thanks for your advise.

    #11036 quote
    DavidDavid
    Participant
    Veteran

    I’m not sure what you mean by your own DOpen (Dopen() is used to get the price of a previous daily open) but I’m guessing you want this?

    // No positions will open before this time so only at or after this time but make sure you have the time zone on the platform to South Africa and that this code is at the beginning of your system 
    DEFPARAM FlatBefore = 083000 

    // Close all positions and don’t open any positions after
    //DEFPARAM Flatafter = ??????

    If that’s not what you’re after maybe a more specific example would help.

    #11045 quote
    algotraderalgotrader
    Participant
    Average

    Hi dwgfx
    Thank for your comment.

    What I want to achieve is to create a ‘constant variable’ based on the ‘Open’ value of the candlestick at the exact time of 083000

    Thanks,
    A.

    #11046 quote
    algotraderalgotrader
    Participant
    Average

    I came up with this:

    Once DayOpeningValue = 0
    IF time = 083000 THEN
    DayOpeningValue = Open
    ELSE
    DayOpeningValue = DayOpeningValue
    
    ..Your code here..
    
    ENDIF

    But maybe there is a better way of coding..?

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

From idea to ProBuilder code in seconds.

Your coding copilot for ProRealTime™. Ask in plain English — get clean, ready-to-paste indicators, screeners and systems.

Available in 7 languages
Try ProRealAI

How to Force DOpen value of a specific time


General Trading: Market Analysis & Manual Trading

New Reply
Author
author-avatar
algotrader @algotrader Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by algotraderalgotrader
10 years, 1 month ago.

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 07/28/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...