Announcement

Collapse
No announcement yet.

coloured squares on top corner of chart

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

  • coloured squares on top corner of chart

    Trying to work out how to put coloured shapes on the chart at the top that do not move and that you can change its colour of.
    opposite the chart symbol label.
    sam

  • #2
    sam
    You can accomplish that using the drawTextPixel() function.
    In the enclosed example you can change the color and the width of the colored block through Edit Studies
    Alex

    PHP Code:
    function preMain(){
        
    setPriceStudy(true);
        
    setShowCursorLabel(false);
        
        var 
    fp1 = new FunctionParameter("Color1",FunctionParameter.COLOR);
        
    fp1.setDefault(Color.yellow);
        
        var 
    fp2 = new FunctionParameter("Width1",FunctionParameter.NUMBER);
        
    fp2.setDefault(200);
        
    }
     
    function 
    main(Color1,Width1){
        
        
    drawTextPixel(00" "nullColor1nullnull10"test"Width115);
        
        return;

    Comment


    • #3
      Thanks Alexis
      sam

      Comment

      Working...
      X