Substitute Values in variable.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5023 quote
    xel
    Participant
    Average

    Hi!

    Is there a way in ProBuilder to generate a variable, say “V” with “1” from a series that have values of “0” or “NotANumber” ?

    As a example:  V = if volume == 0 or “not a number” then 1

    Thanks!

    #5028 quote
    Nicolas
    Keymaster
    Master

    You can’t have string affected to variable. So your “V” variable would never record something else than numbers.

    Maybe you could post an example of what you expect exactly and I’ll could be more precise 🙂

    #5029 quote
    xel
    Participant
    Average

    Im porting one of my indicators that use Volume to plot data, but some tickers do not have volume reported or just as cero in TV. (Some Indexes, Forex, etc).  So, for this kind of situations, I want to report volume as 1 given multiplication weighting in my algorithm.

    #5030 quote
    xel
    Participant
    Average

    I don’t know if this statement works, ProBuilder editor doesn’t give me any error by now.  Not finished yet but…

    Vo = volume
    IF Vo = 0 or Vo = undefined then
    Vo = 1
    ENDIF
    #5031 quote
    Nicolas
    Keymaster
    Master

    You don’t have to test if Vo = undefined. The platform would never return this kind of value. If there are no values, then the variable would return 0. See my example in the picture below on forex.

    #5034 quote
    xel
    Participant
    Average

    GREAT!  That will do the trick!

    Thanks again Nicolas!

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

Substitute Values in variable.


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
xel @xel Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by xel
9 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/07/2016
Status: Active
Attachments: No files
Logo Logo
Loading...