Custom values on an array

Forums ProRealTime English forum ProBuilder support Custom values on an array

Viewing 7 posts - 1 through 7 (of 7 total)
  • #181234

    Hi to all! I use a simple code on an indicator, just to plot some custom values on a subchart below SPX. My code is :

    if DATE = 20211028 THEN
    MyIndicator = 4440
    endif
    if DATE = 20211029 THEN
    MyIndicator = 4445
    endif

    Return MyIndicator as “MyIndicator”

     

    Because after the values are now 2-3 years, the whole platform starts to lag a little bit. So, I wonder, can I put my values on arrays, so to have a lighter code?

    And if yes, how to transform correct? Any example please????

     

     

    #181289

    Did you mean something like this one?

    You can add more elements at the beginning of the code, then replace 2 by the number of elements you have used.

     

    #181487

    Thank you very much for your help! I am just thinking, if there is a way to not use the $MyDate, but to use only one time a StartDate value. Is this possible???? Appreciate any help

    #181491

    Can you make an example?

     

    #181492

    StartDay = 20211101 then

    $MyValue[1] = 4440
    $MyValue[2] = 4445

    $MyValue[3] = 4550

    $MyValue[4] = 4600

    $MyValue[5] = 4732

    $MyValue[6] = 4660

    And then, Return myIndicator from the Startday with values from MyValue[1] to MyValue[6].  Something like this…

    #181493

    Yes, there you go:

     

    #181494

    Thank you again! With this code, I just limit the manual data entry only on 1 value. Have a nice day Roberto

     

    1 user thanked author for this post.
Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login