How can I add a signal to enter/exit trades on this indicator? - page 2

 
Pedro Severin:

Like this?

Yes, looks right.

Pedro Severin:

I used the part that I posted in the last post and got this results, lol:

It seems that, for some reason I have a valid setup to enter, but at the same time it gets wiped out because of wae. Maybe because I was using the current bar 0?

Not necessarily... need to see the time of open/close to be certain. But what I do know is that bar 0 data is unstable. See if the new code makes any difference...