Announcement

Collapse
No announcement yet.

Variation % in cursor window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Variation % in cursor window

    Hello, i would like to add a formula in the cursor window that write the variation in % of the bar between the opening and closing.

    Like in this image:


    Can you help me?
    Thanks you

    P.S: sorry for the bad langage i'm french

  • #2
    this mightbe a good place to start

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("varPct");
    setCursorLabelName("Var%", 0);
    setDefaultBarStyle(PS_SOLID, 0);
    setDefaultBarFgColor(Color.red, 0);
    setDefaultBarThickness(1, 0);
    setPlotType(PLOTTYPE_LINE, 0);
    }

    function main() {

    x=-open(0)+close(0)
    x=x/open(0)
    return (x*100).toFixed(4);
    }

    Comment

    Working...
    X