Stoploss and Profit Order Modification ?

Questions about MultiCharts and user contributed studies.
buylosellhi
Posts: 14
Joined: 20 Jun 2012

Stoploss and Profit Order Modification ?

Postby buylosellhi » 21 Jun 2012

Hi, I'm new to MC and just getting a feel for how everything works.
is it possible to set initial stop loss and profit using the commands SetStopLoss and SetProfitTarget in a script and then modify them in chart trading mode by manually dragging the order lines on the chart ?

thanks in advance for your help

User avatar
Henry MultiСharts
Posts: 8394
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2682 times

Re: Stoploss and Profit Order Modification ?

Postby Henry MultiСharts » 22 Jun 2012

buylosellhi wrote:Hi, I'm new to MC and just getting a feel for how everything works.
is it possible to set initial stop loss and profit using the commands SetStopLoss and SetProfitTarget in a script and then modify them in chart trading mode by manually dragging the order lines on the chart ?

thanks in advance for your help

Hello Buylosellhi,

Yes that is possible to manually drag the order placed by the auto trading.
If the order is cancelled but the condition for the order is still met on the next strategy calculation - strategy will place the order again.

If the order is moved and filled-the strategy will use average fill price and amount to continue operation.

If the order amount is modified but the order is not filled until next bar - the order will be cancelled and auto trading will place the order generated by the strategy (if the condition in the code is still met).

If the order price is modified but the order is not filled until next bar - the order will be modified, parameters would be set according to the strategy. The order can be cancelled if the condition in the code is no longer met.

buylosellhi
Posts: 14
Joined: 20 Jun 2012

Re: Stoploss and Profit Order Modification ?

Postby buylosellhi » 22 Jun 2012

Henry,
Thanks for your reply. I think I almost followed you ;-)
What I'm trying to do is the following:
1) automatically enter when entry conditions are met
2) set an initial stop loss that I can possibly drag on the chart to modify (manual trailing stop)
3) if I haven't gotten out of the trade and conditions are met, exit the position (which also means that if I have manually gotten out then nothing happens on the exit and strategy waits for the next entry order)

1) is straightforward. For 2) if I understood you correctly then once a new bar starts SetStopLoss will set the order at it's original price ?
And for 3) should I just use marketposition to generate exit condition or manual exit won't be picked up by the strategy, in which should I use GetPositionQuantity to get the position at the account level.

Hope im clear in what I'm asking. Thanks in advance for your help

buylosellhi
Posts: 14
Joined: 20 Jun 2012

Re: Stoploss and Profit Order Modification ?

Postby buylosellhi » 23 Jun 2012

Hi,
if I wanted to keep things really simple, would the following work ?

1) if account position is flat (GetPositionQuantity=0) then execute entry signals and
2) if account position in not flat as per GetPositionQuantity then execute exit signals

here if I manually exited the trade after auto-entry then auto-exit condition wont trigger as per 2).

does this somehow screw up how the strategy keeps track of the everything ? And what exact settings should I use in the Autotrader for proper synchronization between broker and strategy ?

thanks in advance for your help

User avatar
Henry MultiСharts
Posts: 8394
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2682 times

Re: Stoploss and Profit Order Modification ?

Postby Henry MultiСharts » 26 Jun 2012

buylosellhi wrote:2) if I understood you correctly then once a new bar starts SetStopLoss will set the order at it's original price ?

That is correct.
buylosellhi wrote:And for 3) should I just use marketposition to generate exit condition or manual exit won't be picked up by the strategy, in which should I use GetPositionQuantity to get the position at the account level.

That is correct, you can use marketposition and/or GetPositionQuantity.
buylosellhi wrote:Hi,
if I wanted to keep things really simple, would the following work ?
1) if account position is flat (GetPositionQuantity=0) then execute entry signals and
2) if account position in not flat as per GetPositionQuantity then execute exit signals
here if I manually exited the trade after auto-entry then auto-exit condition wont trigger as per 2).
does this somehow screw up how the strategy keeps track of the everything ? And what exact settings should I use in the Autotrader for proper synchronization between broker and strategy ?
thanks in advance for your help

This will work and the strategy will know that exit orders placed by it were filled, market position has changed if you will drag the orders placed by the strategy.

If you will apply a separate exit strategy or close the position manually-you can use !From Broker To Strategy MP Synchronizer! signal to pass this info to the strategy (Synchronizes the market position inside MultiCharts with the market position at broker by sending a dummy order in charting).


Return to “MultiCharts”