Announcement

Collapse
No announcement yet.

volume growth

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

  • volume growth

    Hi

    Can you make an indicator which colored the current bar in red (or another color) when the volume of the current bar is more than 50% of the volume of the precedent bar ?

    Also can you make the volume growth detection as a variable (for example the volume can rise 50%, or 80% or more as defined by the user to create a signal) ?

    Kind regards

    pbereau

  • #2
    pbereau
    The enclosed script should do what you asked. The percent value (default is 50) can be modified through Edit Studies
    Alex

    PHP Code:
    function preMain() {

        
    setPriceStudy(false);
        
    setStudyTitle("Volume");
        
    setCursorLabelName("Volume"0);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarThickness(2,0);
        
    setPlotType(PLOTTYPE_HISTOGRAM,0);
        
        var 
    fp1 = new FunctionParameter("Percent"FunctionParameter.NUMBER);
        
    fp1.setDefault(50);
    }

    function 
    main(Percent) {

        if(
    volume(0)>volume(-1)+((volume(-1)*Percent)/100)){
        
    setBarFgColor(Color.red);
        }
       
        return 
    volume();

    Comment

    Working...
    X