StopLoss and PercentTrailing Strategy
StopLoss and PercentTrailing Strategy
Maybe someone found a solution ...... can somehow StopLoss and PercentTrailing indicate fulfill orders limit orders?
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: StopLoss and PercentTrailing Strategy
Can you elaborate a bit more on what you are seeking?Maybe someone found a solution ...... can somehow StopLoss and PercentTrailing indicate fulfill orders limit orders?
Maybe with an example?
Re: StopLoss and PercentTrailing Strategy
StopLoss sends a Market Order. I want to send that Limit orders.
If long position:
SetStopLoss;
Sell next bar at (Price StopLoss) limit;
If long position:
SetStopLoss;
Sell next bar at (Price StopLoss) limit;
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: StopLoss and PercentTrailing Strategy
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
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: StopLoss and PercentTrailing Strategy
ps: [FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713
viewtopic.php?f=16&t=11713
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: StopLoss and PercentTrailing Strategy
There's an example here of stop-limit orders.Maybe someone found a solution ...... can somehow StopLoss and PercentTrailing indicate fulfill orders limit orders?
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)?StopLoss sends a Market Order. I want to send that Limit orders.
If long position:
SetStopLoss;
Sell next bar at (Price StopLoss) limit;
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.
Re: StopLoss and PercentTrailing Strategy
What is not clear from the logic? In MC9 StopLoss market orders executed. I want to StopLoss and PercentTrailing limit order is executed.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: StopLoss and PercentTrailing Strategy
If you already have the logic clear in mind (that is, which programming steps to take), what issue do you run into?What is not clear from the logic? In MC9 StopLoss market orders executed. I want to StopLoss and PercentTrailing limit order is executed.
Re: StopLoss and PercentTrailing Strategy
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 ) ;
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: StopLoss and PercentTrailing Strategy
Nobody is professional in the EL, that's why we are here.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 ) ;
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
Re: StopLoss and PercentTrailing Strategy
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.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: StopLoss and PercentTrailing Strategy
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.