Issues with setting a stoploss  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
ClarkFX
Posts: 5
Joined: 06 Jul 2012
Location: Canada
Contact:

Issues with setting a stoploss

Postby ClarkFX » 14 Oct 2012

When I set a stoploss to a position I use the method invocation GenerateStopLoss(SL);

This expression does not contain the current price of the instrument. Is there a way to update the stoploss by using the current price?

For example, it should be something like this: UpdateStopLoss(CurrentPrice - NumberOfPips) for a long position.

Another question is that the expression GenerateStopLoss(SL) does not associate the stoploss with a specific position when multiple positions are open.

If there are two or more open positions, will the GenerateStopLoss(SL) expression affect all the open positions? Is there a way to modify only one of them?

Many thanks.

User avatar
Henry MultiСharts
Posts: 8435
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2703 times

Re: Issues with setting a stoploss  [SOLVED]

Postby Henry MultiСharts » 15 Oct 2012

ClarkFX wrote:When I set a stoploss to a position I use the method invocation GenerateStopLoss(SL);
This expression does not contain the current price of the instrument. Is there a way to update the stoploss by using the current price?
For example, it should be something like this: UpdateStopLoss(CurrentPrice - NumberOfPips) for a long position.

Hello ClarkFX,

You need to emulate the stoploss by sending the stop order with the price you need. This order can be replaced and modified.

ClarkFX wrote:Another question is that the expression GenerateStopLoss(SL) does not associate the stoploss with a specific position when multiple positions are open.
If there are two or more open positions, will the GenerateStopLoss(SL) expression affect all the open positions? Is there a way to modify only one of them?
Many thanks.

You need to use ExitFromEntry orders.


Return to “MultiCharts .NET”