ABC,
Thank you for your input,
- When do you want to send the order?
Let's name this stoplossorder from now on.
The stoplossorder must be send at the same time or direct after the entry.
This is the entry:
Code: Select all
then
begin
sellshort ("rsisell") next bar open;
end;
What price should be used i.e. use the value of Variable2 at the time of the entry or at the time of the order (or from another time).
The price used must be the price at the time of the entry (entryprice). Value2 is the price where the stoplossorder must be placed.
I think that the stoplossorder only can be calculated after the entry because only then the entryprice can be used to calculate the sum of value2.
- Do you want to update the order price while you are in the position?
No, the stoplossorder does not update or trail the position, it is a fixed stoploss.
This is my takeprofit:
Code: Select all
[IntrabarOrderGeneration=False]
if marketposition = -1 and CloseD (0) < entryprice
then
begin
buytocover ("rsishortprofit") next bar;
end;
When the position is closed by this takeprofit then the stoplossorder must be removed/deleted for it has no further use.
Regards,
Erik