Starting code from zero

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #13861 quote
    HenryHenry
    Participant
    Average

    A request that was addressed to ProRealTime:

    Hi,

    I want this code to start counting from 0 instead of it being summed. And if the code is not true it just goes “_________”, it’s flat.

    How do i make the code start from 0? (when criteria stops being true it turns flat,i want to to turn to zero and when criteria becomes true again i want it to start from 0.

    Thanks in advance

    if close < average[10]then
    add=add+volume
    
    
    endif
    
    return add

    Suggestion for an anwser:

    Once the condition is not verified any more, we put the variable to zero

    if close < average[10] then
    add=add+volume
    else
    add=0
    endif
    
    return add
    Nicolas thanked this post
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Starting code from zero


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Henry @henry Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/28/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...