Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 7/22/2007(UTC) Posts: 16
|
I Expert advisor, I'm trying to work out how to relate the entry price from a "buy" signal to the "exit" signal but a variable created from the "buy" signal is not recognised when creating the "sell" signal.
In other words, say I have my buy (long) signal and the price is $10 and I set my initial stop/loss at SL:=9.9
Say in 10 days time the stock has risen and then dropped to $9.80. How do I get my "sell" signal formula to recognise the variable "SL" which was created in the "buy" signal formula?
Thanks
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 9/22/2006(UTC) Posts: 14
|
Maybe this will help. The following code would set a stoploss of $0.10 below the low of the most recent day on which the BuySignal was generated. How you define whether BuySignal is true or not is up to you.
StopLoss:=ValueWhen(1,BuySignal,Low-0.10);
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.