I am trying to work out the code for putting a stop loss (limit) below the low of the bar before the entry bar (i.e. entry bar minus 1). Any help would be much appreciated, it seems like a simple problem but I don't seem to be able to work it out.
Thanks in advance.
Jim
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
Thanks Eugene, do you also know the code for putting reversing a position at the same bar as the stoploss and at the same price - i.e. for a stop and reverse.
Thanks in advance,
Jim
Size:
Color:
Size:
Color:
Thanks Eugene, you are awesome.
Jim
Size:
Color:
Eugene,
I have tried using this code for a stop loss (i.e. representing sell if price hits entry price less 5%)
CODE:
Please log in to see this code.
But when the Stop Loss is triggered the actual sell price is the price at close not the Stop Loss value, do you know why this could be?
Thanks in advance
Jim
Size:
Color:
Jim,
You are closing out all positions for the price of the last position's entry price minus 5%. However, the price for the bunch is determined based on the last position. Is there a reason to do it this way? There are multiple positions?
As to the actual exit price, it is not the price at close. It could either be the stop price or open price at bar+1, whichever is lower.
Size:
Color: