Hi,
Is there a way of reversing a marketposition in Easy Language in one order. What I read in the EL guides and use right now is the "buy" and "sell short" reserved words. But this uses two different orders. One to close the position and one to open the new position. I would like to do this in one move. For example: 2000 short, then buy 4000, to get 2000 long. And vice versa.
At the moment the strategy creates a close short order of 2000, and then creates an buy order of 2000 to get the wanted 2000 long. This result in extra transaction costs.
Is it possible to do this in one order in easy language?
Thanks in advance!
Kind regards
Edwin
Reverse marketposition
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Reverse marketposition
Hello Edwin,
Sell and BuyToCover generate orders for closing the position.
Buy and SellShort can reverse the position with one order.
Sell and BuyToCover generate orders for closing the position.
Buy and SellShort can reverse the position with one order.
Last edited by Henry MultiСharts on 10 Apr 2012, edited 1 time in total.
Re: Reverse marketposition
Henry,
I was looking to do the same thing but I'm confused. You contradict yourself.
Doing -
- Buy 1 then Sell 1 (Enter Long, Close Long)
- SellShort 1 then Buytocover 1 (Enter Short, Close Short)
Could incur two lots of slippage.
What I would like to do, assuming we enter the market on a Long position -
Buy 1
Sell 2
Buy 2
Sell 2
Buy 2 etc etc
This should give me a single contract in each direction and only 1 lot of slippage per trade.
Could you please provide an example of code on how to do this.
Neil.
I was looking to do the same thing but I'm confused. You contradict yourself.
In http://www.multicharts.com/discussion/v ... rse#p44579 you state the opposite -Hello Edwin,
SellShort and BuyToCover generate orders for closing the position.
Buy and Sell can reverse the position with one order.
I always want to be in the maket, so I want to Buy 1 contract and then short 2 (1 closes my long trade and the second enters my short trade direction) the idea being that there is only one order and the possibility of slippage only exists once."Sellshort" is used to reverse. if you want to close long position, use "sell".
Buy -> Sell
Sellshort -> Buytocover
Doing -
- Buy 1 then Sell 1 (Enter Long, Close Long)
- SellShort 1 then Buytocover 1 (Enter Short, Close Short)
Could incur two lots of slippage.
What I would like to do, assuming we enter the market on a Long position -
Buy 1
Sell 2
Buy 2
Sell 2
Buy 2 etc etc
This should give me a single contract in each direction and only 1 lot of slippage per trade.
Could you please provide an example of code on how to do this.
Neil.
Re: Reverse marketposition
See Henry, even you are confused sometimes. Don't worry even I do sometimes despite the fact I've been using MC for over two years now. The cover orders are:
sell and buytocover
To go net short use sellshort, and to go net long use buy.
These keyword names are so confusing especially for novices. We should be using keywords like:
to go net short: sellshort (no change)
to go net long: buylong (same as buy)
to cover existing shorts: buytocover (no change)
to cover exiting longs: selltocover (same as sell)
It would be really nice to add the two new keywords above so we can re-write our strategies to read more correctly according to standard practices in trading. It would be such a trivial change to PL yet has the powerful benefit of removing any confusion about what the keywords mean. The existing ones remain of course for backward compatibility.
sell and buytocover
To go net short use sellshort, and to go net long use buy.
These keyword names are so confusing especially for novices. We should be using keywords like:
to go net short: sellshort (no change)
to go net long: buylong (same as buy)
to cover existing shorts: buytocover (no change)
to cover exiting longs: selltocover (same as sell)
It would be really nice to add the two new keywords above so we can re-write our strategies to read more correctly according to standard practices in trading. It would be such a trivial change to PL yet has the powerful benefit of removing any confusion about what the keywords mean. The existing ones remain of course for backward compatibility.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Reverse marketposition
Sorry for confusion Nick. Thank you for correction Janus.
Sell and buytocover are exit orders.
Sellshort and buy are entries and reverses.
Sell and buytocover are exit orders.
Sellshort and buy are entries and reverses.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Reverse marketposition
Hello Neil,
Buy and SellShort code words allow reversing the position.
Command opposite to your current position should be used with the target amount of contracts.
Here is an example of script for your pattern:
Buy and SellShort code words allow reversing the position.
Command opposite to your current position should be used with the target amount of contracts.
Here is an example of script for your pattern:
Code: Select all
if marketposition=0 then buy next bar at market;
if marketposition=1 then SellShort 1 Contract Next Bar at Market;
if marketposition=-1 then buy 1 Contract next bar at market;
Re: Reverse marketposition
Henry,Hello Neil,
Buy and SellShort code words allow reversing the position.
Command opposite to your current position should be used with the target amount of contracts.
Here is an example of script for your pattern:Code: Select all
if marketposition=0 then buy next bar at market;
if marketposition=1 then SellShort 1 Contract Next Bar at Market;
if marketposition=-1 then buy 1 Contract next bar at market;
So are you saying that if I Buy 1 contract and then do a SellShort 1 contract, the order that is actually placed with the broker is a "Sell 2 Contracts"? 1 Contract closes the trade and the second starts a short position?
The SellShort does both things at once, closes the existing trade and opens a fresh trade in the opposite direction?
I thought this may have been how the "Total" statement was meant to work but it doesn't seem to do anything.
Ie SellShort 2 Contract Total Next Bar at Market;
My tests in either of the above examples tend to indicate that TWO separate orders are sent to the broker thus incurring TWO amounts of slippage when if an order was placed for twice the size, only one lot of slippage would be incurred.
Neil.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Reverse marketposition
Correct.Henry,
So are you saying that if I Buy 1 contract and then do a SellShort 1 contract, the order that is actually placed with the broker is a "Sell 2 Contracts"? 1 Contract closes the trade and the second starts a short position?
The SellShort does both things at once, closes the existing trade and opens a fresh trade in the opposite direction?
Total word is allowed only for exits.I thought this may have been how the "Total" statement was meant to work but it doesn't seem to do anything.
Ie SellShort 2 Contract Total Next Bar at Market;
Please let me know who is your broker.My tests in either of the above examples tend to indicate that TWO separate orders are sent to the broker thus incurring TWO amounts of slippage when if an order was placed for twice the size, only one lot of slippage would be incurred.
Neil.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Reverse marketposition
I have checked this sample script on IB demo and it works properly. Please have a look at the attached screenshot.Hi Henry,
My broker is IB but that shouldn't make any difference, because the order that MC sends to the broker should be Sell 2 @ Market. This should be independent of broker.
Neil.
If you still have the issue - please come to our live chat Monday-Friday 6:30 am - 4 pm EST to demonstrate this behaviour. We will do our best to help you.
- Attachments
-
- Reverse.png
- (15.83 KiB) Downloaded 1363 times