StopLoss and PercentTrailing Strategy

Questions about MultiCharts and user contributed studies.
AlexKendo
Posts: 20
Joined: 12 Sep 2012

StopLoss and PercentTrailing Strategy

Postby AlexKendo » 29 Jun 2015

Maybe someone found a solution ...... can somehow StopLoss and PercentTrailing indicate fulfill orders limit orders?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: StopLoss and PercentTrailing Strategy

Postby TJ » 29 Jun 2015

Maybe someone found a solution ...... can somehow StopLoss and PercentTrailing indicate fulfill orders limit orders?
Can you elaborate a bit more on what you are seeking?
Maybe with an example?

AlexKendo
Posts: 20
Joined: 12 Sep 2012

Re: StopLoss and PercentTrailing Strategy

Postby AlexKendo » 29 Jun 2015

StopLoss sends a Market Order. I want to send that Limit orders.

If long position:

SetStopLoss;
Sell next bar at (Price StopLoss) limit;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: StopLoss and PercentTrailing Strategy

Postby TJ » 29 Jun 2015

StopLoss sends a Market Order. I want to send that Limit orders.

If long position:

SetStopLoss;
Sell next bar at (Price StopLoss) limit;

If you want a limit order, you have to write out the logic in your script.


If you need help writing the code, you can start here:
[FAQ]
viewtopic.php?f=16&t=6929

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: StopLoss and PercentTrailing Strategy

Postby TJ » 29 Jun 2015

ps: [FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: StopLoss and PercentTrailing Strategy

Postby JoshM » 29 Jun 2015

Maybe someone found a solution ...... can somehow StopLoss and PercentTrailing indicate fulfill orders limit orders?
There's an example here of stop-limit orders.
StopLoss sends a Market Order. I want to send that Limit orders.

If long position:

SetStopLoss;
Sell next bar at (Price StopLoss) limit;
Or do you want to use limit orders? Or perhaps a stop-loss market order and a limit order (as in the code example you mentioned)?

Once you know what you want, you can start writing out the logic as TJ said. But you first need to be clear on what you want to code. :)

AlexKendo
Posts: 20
Joined: 12 Sep 2012

Re: StopLoss and PercentTrailing Strategy

Postby AlexKendo » 29 Jun 2015

What is not clear from the logic? In MC9 StopLoss market orders executed. I want to StopLoss and PercentTrailing limit order is executed.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: StopLoss and PercentTrailing Strategy

Postby JoshM » 30 Jun 2015

What is not clear from the logic? In MC9 StopLoss market orders executed. I want to StopLoss and PercentTrailing limit order is executed.
If you already have the logic clear in mind (that is, which programming steps to take), what issue do you run into?

AlexKendo
Posts: 20
Joined: 12 Sep 2012

Re: StopLoss and PercentTrailing Strategy

Postby AlexKendo » 30 Jun 2015

I'm not a professional in the EL. It is not clear how to write code execution closing positions via limit orders.

Code: Select all

[IntrabarOrderGeneration = false]
inputs: PositionBasis( false ), Amount( 1 ) ;

if PositionBasis then
SetStopPosition
else
SetStopShare ;

SetStopLoss( Amount ) ;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: StopLoss and PercentTrailing Strategy

Postby TJ » 30 Jun 2015

I'm not a professional in the EL. It is not clear how to write code execution closing positions via limit orders.

Code: Select all

[IntrabarOrderGeneration = false]
inputs: PositionBasis( false ), Amount( 1 ) ;

if PositionBasis then
SetStopPosition
else
SetStopShare ;

SetStopLoss( Amount ) ;
Nobody is professional in the EL, that's why we are here.
No need to feel inadequate; you just have to read the book, read the book, follow the examples in the book, and you will be alright.


Please read read post #1 in this link.
Read the first ebook in the post #1
viewtopic.php?f=16&t=6929


See also post #3 in the link
SetStopLoss

AlexKendo
Posts: 20
Joined: 12 Sep 2012

Re: StopLoss and PercentTrailing Strategy

Postby AlexKendo » 30 Jun 2015

Thanks. I have this book. The problem is that I wrote on the forum waiting for tips. After all, here we have to do together, as you have written. If EL professionals is not difficult, I can pay for the services.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: StopLoss and PercentTrailing Strategy

Postby TJ » 30 Jun 2015

Thanks. I have this book. The problem is that I wrote on the forum waiting for tips. After all, here we have to do together, as you have written. If EL professionals is not difficult, I can pay for the services.

Please see post #4 in this thread again:

>If you want a limit order, you have to write out the logic in your script.

ie. SetStopLoss is a shortcut. if you DO NOT want market orders, you cannot use SetStopLoss. You have to write out the logic yourself. You have to read the book and learn to write the logic. There are examples in the book.


Return to “MultiCharts”