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.
With hand drwan lines clicking on the line adds a a "target box" to the cursor. This doesn't appear.
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);
with( aFPArray[x] ) {
setName("Stop Loss");
setLowerLimit( 0 );
setDefault( 0 );
}
x++;
aFPArray[x] = new FunctionParameter( "P1", FunctionParameter.NUMBER);
with( aFPArray[x] ) {
setName("Prfoit Target 1");
setLowerLimit( 0 );
setDefault( 0 );
}
x++;
aFPArray[x] = new FunctionParameter( "P2", FunctionParameter.NUMBER);
with( aFPArray[x] ) {
setName("Prfoit Target 2");
setLowerLimit( 0 );
setDefault( 0 );
}
}
function main(SL, P1, P2) {
// on click: askForInput( "Targets" );
if ( getCurrentBarIndex() == 0 ) {
addLineTool(LineTool.HORZ, SL, 1, Color.red, "SL");
addLineTool(LineTool.HORZ, P1, 1, Color.aqua, "P1");
addLineTool(LineTool.HORZ, P2, 1, Color.blue, "P2");
}
return;
}