rottentrade
Member
I would like to enter or exit a trade only when the recent signal is x distance (both horizontally and vertically) from the previous signal. For example, exit XYZ when price is at least x bars from the entry (horizontally) and at least $1 above the entry (vertically). I'm having trouble including the previous signal in the formula.
How would I write that in the code ("sell" below)?
def buy = Average(close, 10) crosses above Average(close, 20);
def sell = if close is greater than 5 days from "buy" AND above $1 from "buy";
Thanks for the help.
How would I write that in the code ("sell" below)?
def buy = Average(close, 10) crosses above Average(close, 20);
def sell = if close is greater than 5 days from "buy" AND above $1 from "buy";
Thanks for the help.