[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coding a stop



PureBytes Links

Trading Reference Links

Hi all,

I`m trying to create a stop where if I`m long, and this bar`s close is >
"amount" than open (meaning it`s an up bar) then a stop should be placed
0.1 under the low. The problem is, that it on works for the next bar,
but if the next bar is not > "amount" (and therefore the stop will not
move to under its low) and then the NEXT bar will go lower than the low
of two bars ago - 0.1, the stop won`t work...
Here`s the code so far:

var: stoppl(0);
input: num(2);
stoppl=low of this bar-0.1;
if   close-open > num  then exitlong at stoppl stop;

Any help would be greatly appreciated!
Philip