As you have it, "stop" should only change when there is a new buy signal. Unless you have a buy signal at every bar, then it should not change at every bar.
I don't know your intention with this code, but note that "stop" is a single value, not an array. Regards, GP --- In [email protected], faked <[EMAIL PROTECTED]> wrote: > > Hi Group, > > I want to set my stop to low 1 bar before buy-signal. > For example: If I use EOD and i get today a buy-signal, the stop shoud > be set to the low from yesterday. > > for(i = 1; i < barcount; i++) > { > if ( Buy[i] ) > { > stop = Low[ i-1 ]; > } > } > > .... > > My problem is, every bar, my stop changes, but it should be stay at > the same value. > > Thanks for help > faked >
