Behavior [1] stored variable

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #169488 quote
    Albaran
    Participant
    Average

    Hi there,

    If you assign a variable to every specific day of the week:

    If DayofWeek = 1 then
    VariableX = a
    elsif Dayofweek = 2 then 
    VariableX = b
    elsif  Dayofweek = 3 then 
    VariableX = c
    elsif  Dayofweek = 4 then 
    VariableX = d
    elsif  Dayofweek = 5 then 
    VariableX = e
    Endif

    will the system understand that you want to use the VariableX of the previous day if you use the “[1]“?

    E.G. if we’re in DayofWeek = 3 and you use “VariableX[1]“, does the system understand that you want to use the VariableX of DayofWeek = 2?

    Thanks a lot for the replies..

    #169493 quote
    robertogozzi
    Moderator
    Master

    Yes, that’s exactly what it is.

    At every NEW candle  that opens, ProRealTime will make a copy of the past value as the new one for each variable. If you never change it, the original value will be retained till the code stops. If you change it, the change affects ONLY the current candle, not prior values!

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

Behavior [1] stored variable


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Albaran @albaran Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
4 years, 9 months ago.

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