Value at a specific time Yesterday

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #235788 quote
    phoentzs
    Participant
    Master

    Hello, I needed a tip… I want to compare a value (close/high/low) at a certain time from yesterday with today. I can’t seem to get any further.

    if time=090000 then
    myclose=close
    endif
    
    if time=090000 and ???? then
    mycloseYesterday=close
    endif
    
    sig = myclose > mycloseyesterday

    This code needs to be completed. Anyone have any ideas?

    #235789 quote
    robertogozzi
    Moderator
    Master

    There you go:

    ONCE PriceToday     = 0
    ONCE PriceYesterday = 0
    if time=090000 then
       PriceYesterday = PriceToday
       PriceToday     = close
    endif
    sig = PriceToday > PriceYesterday
    phoentzs and Iván González thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Value at a specific time Yesterday


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
1 year, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/25/2024
Status: Active
Attachments: No files
Logo Logo
Loading...