new order after stop loss

Created at 23 Nov 2016, 14:59
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CO

collinganesh

Joined 14.10.2016

new order after stop loss
23 Nov 2016, 14:59


Hi all,

How do I code to open a new order only after stop loss is triggered on an opened position.

Example,

ExecuteMarketOrder(tradeType, Symbol, volume, "Martingale", StopLoss, TakeProfit);

kind regards

 

 


@collinganesh
Replies

davidp13
23 Nov 2016, 15:09

the easiest would be to test if a position is open or not and if not then execture the order.

Somthing like:

if position == null

executemarketorder...


@davidp13

collinganesh
23 Nov 2016, 18:30

Thanks David. I will try the code.


@collinganesh

... Deleted by UFO ...

... Deleted by UFO ...

collinganesh
23 Nov 2016, 20:05

Will try. Thank you for your help.

Kind regards


@collinganesh

alexander.n.fedorov
13 Jan 2019, 18:03

How can I use that

 

 

            position = args.Position;
            position.StopLossTriggerMethod;
            {

            }


@alexander.n.fedorov

PanagiotisCharalampous
14 Jan 2019, 11:10

Hi Sasha,

This enum indicates the way SL was triggered. Here are the enum values.

Best Regards,

Panagiotis


@PanagiotisCharalampous

alexander.n.fedorov
14 Jan 2019, 13:49

Logged in.

Still, for me it is not clear 

What I want to is if the order stoppped our, open new order in opposite directionat the point where it was stopped out. It will take me a week to figure out

Panagiotis, help, please

 

 

Rregards

 

Sasha


@alexander.n.fedorov

alexander.n.fedorov
14 Jan 2019, 13:49

RE:

alexander.n.fedorov said:

Logged in.

Still, for me it is not clear 

What I want to is if the order stoppped our, open new order in opposite directionat the point where it was stopped out. It will take me a week to figure out

Panagiotis, help, please

 

 

Rregards

 

Sasha

p.s. stoppet out


@alexander.n.fedorov

alexander.n.fedorov
14 Jan 2019, 13:50

RE: RE:

alexander.n.fedorov said:

alexander.n.fedorov said:

Logged in.

Still, for me it is not clear 

What I want to is if the order stoppped our, open new order in opposite directionat the point where it was stopped out. It will take me a week to figure out

Panagiotis, help, please

 

 

Rregards

 

Sasha

p.s. stopped out

 


@alexander.n.fedorov

PanagiotisCharalampous
14 Jan 2019, 14:11

Hi Sasha,

The specific variable has nothing to do with stop outs. If you want to know the reason of position closing use obj.Reason.

Best Regards,

Panagiotis


@PanagiotisCharalampous