Qscript Exitlong
Posted: Fri Apr 11, 2025 3:56 pm
Hello everyone,
I start to use Qscript
and I have a little problem with this code. Every long exit or short exit is on the same 1 minute bar of the entry, I have +1, -1 or -1, +1 on the same bar. I just want 10 points of profit or 10 points of stop loss for the system report.
Thanks a lot,
if (avg1 crosses over avg2) {
buy(1, close, "market", "day");
exitlong(0,entryprice+10,"market","day"); # Take profit
exitlong(0,entryprice-10,"stop","day"); # Stop loss
}
if (avg1 crosses under avg2) {
sell(1, close, "market", "day");
exitshort(0,entryprice+10,"market","day"); # Take profit
exitshort(0,entryprice-10,"stop","day"); # Stop loss
}
plot1 = avg1;
color1 = blue;
plot2 = avg2;
color2 = red;
I start to use Qscript

Thanks a lot,
if (avg1 crosses over avg2) {
buy(1, close, "market", "day");
exitlong(0,entryprice+10,"market","day"); # Take profit
exitlong(0,entryprice-10,"stop","day"); # Stop loss
}
if (avg1 crosses under avg2) {
sell(1, close, "market", "day");
exitshort(0,entryprice+10,"market","day"); # Take profit
exitshort(0,entryprice-10,"stop","day"); # Stop loss
}
plot1 = avg1;
color1 = blue;
plot2 = avg2;
color2 = red;