Announcement

Collapse
No announcement yet.

Dragging a line drawn with addLineTool() function

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

  • Dragging a line drawn with addLineTool() function

    Is it possible drag a line that you have drawn using addLineTool() function.
    Tried that with this script - can't move lines by click, drag & drop.


    PHP Code:
    /*********************************************************
    Plot Profit Targets and Stop Loss
    **********************************************************/
    var aFPArray = new Array();
    var 
    SL 0;
    var 
    P1 0;
    var 
    P2 0;
    function 
    preMain() {

        
    setPriceStudy(true);
        
    setStudyTitle("PTSL");
        var 
    x=0;
        
    aFPArray[x] = new FunctionParameter"SL"FunctionParameter.NUMBER);
        
    withaFPArray[x] ) {
            
    setName("Stop Loss");
            
    setLowerLimit);
            
    setDefault);
        }
        
    x++;
        
    aFPArray[x] = new FunctionParameter"P1"FunctionParameter.NUMBER);
        
    withaFPArray[x] ) {
            
    setName("Prfoit Target 1");
            
    setLowerLimit);
            
    setDefault);    
        }
        
    x++;
        
    aFPArray[x] = new FunctionParameter"P2"FunctionParameter.NUMBER);
        
    withaFPArray[x] ) {
            
    setName("Prfoit Target 2");
            
    setLowerLimit);
            
    setDefault);
        }
    }


    function 
    main(SLP1P2) {
    // on click:      askForInput( "Targets" ); 

        
    if ( getCurrentBarIndex() == ) {
        
    addLineTool(LineTool.HORZSL1Color.red"SL");
        
    addLineTool(LineTool.HORZP11Color.aqua"P1");
        
    addLineTool(LineTool.HORZP21Color.blue"P2");
        }

        return;

    With hand drwan lines clicking on the line adds a a "target box" to the cursor. This doesn't appear.
Working...
X