I haven't come across any pre defined functions that will stop you out and exit a position only if bar[0] closes above/below some value---or am i just missing it? not looking for just a cross of that value.
if not I think i could just write my own condition at the beginning of onBarUpdate() that says something like:
if ( [we have a position] )
if Close[0] > myValue
exit position;
Second question would be, what is the proper way to reference a trade in action, for that if statement to determine whether or not we do have a position.
Thanks!
Comment