How to register as a universal value

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #200814 quote
    Forever beginner
    Participant
    New

    There may be strange places because I am using translation

    Is there a way to register any value as universal?
    For example, if close[2] > close[1] and close[1] < close, then set close[1] to x and impossible to change x after that.

    #200824 quote
    Nicolas
    Keymaster
    Master

    So you want to change the value of an internal constant (price of the instrument)? Not possible 🙂

    But you can create your own “constant” by using an array, let’s call it $close

    test = close[2] > close[1] and close[1] < close
    if test then 
     i = i + 1 //increase the array size 
     $close[i] = medianprice //change x with what value you want to store
    endif 
    
    return lastset($close) //visualize the last stored value
    Forever beginner thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

How to register as a universal value


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
3 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/14/2022
Status: Active
Attachments: No files
Logo Logo
Loading...