marketposition skips stop alert
Posted: Jun 26 2017
Hello,
I have an issue with a stop alert not being triggered. I believe it is because once the stop is hit my marketposition is now 0 so it skips the alert.
I am using the code below and I thought by using marketposition(1) it would base the trigger on my most recent position, but for
some reason marketposition(1) is not solving the issue, any suggestions would be greatly appreciated, I have been working on this one
for a long time.
Thank you,
Mike
I have an issue with a stop alert not being triggered. I believe it is because once the stop is hit my marketposition is now 0 so it skips the alert.
I am using the code below and I thought by using marketposition(1) it would base the trigger on my most recent position, but for
some reason marketposition(1) is not solving the issue, any suggestions would be greatly appreciated, I have been working on this one
for a long time.
Thank you,
Mike
Code: Select all
Variables: IntraBarPersist alertAlreadyGiven1(False);
if (CheckAlert = True) then begin
if (alertAlreadyGiven1 = False) and marketposition(1)<0 and close>=level1 then begin
alert("Stop");
alertAlreadyGiven1 = True;
end;
end;