Hedge - Same Instrument - EasyLanguage - Long and Short

Questions about MultiCharts and user contributed studies.
mark-uk
Posts: 6
Joined: 16 Aug 2010

Hedge - Same Instrument - EasyLanguage - Long and Short

Postby mark-uk » 16 Aug 2010

Hedge - Same Instrument - EasyLanguage - Long and Short

Hi there, looking for some assistance

I understand Multicharts has the capability to be long and short at the same time on the same instrument

I have the following code ...

if currentbar = 10 then buy ( "B1-LE" ) 1 contracts next bar at market ;
if currentbar = 10 then sellshort ( "S1-SE" ) 1 contracts next bar at market ;
if currentbar = 100 then sell ( "B1-LX" ) from entry ( "B1-LE" ) 1 contracts next bar at market ;
if currentbar = 50 then buytocover ( "S1-SX" ) from entry ( "S1-SE" ) 1 contracts next bar at market ;

Which produces the following performance report ...

EntryLong B1-LE 15/06/2010 17:00:00 1108 1 Contract
ExitLong S1-SE 15/06/2010 17:00:00 1108 1 Contract
EntryShort S1-SE 15/06/2010 17:00:00 1108 1 Contract
ExitShort S1-SX 15/06/2010 17:42:00 1107.5 1 Contract

So my question is how do i prevent the sellshort order exiting the buy order automatically ?

Many thanks in advance

Mark :)

PS I do have the following ticked ... "Allow unlimited entries and exits per bar"

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

Re: Hedge - Same Instrument - EasyLanguage - Long and Short

Postby TJ » 16 Aug 2010

which broker allows you to hold a long and a short of the same instrument at the same time in the same account?

I am curious to know
where is it documented that Multicharts has the capability to be long and short at the same time on the same instrument?

mark-uk
Posts: 6
Joined: 16 Aug 2010

Re: Hedge - Same Instrument - EasyLanguage - Long and Short

Postby mark-uk » 16 Aug 2010

Thank you for responding

A sampling of brokers that allow long and short of same instrument are FXCM, Dukascopy and PFG

FXCM is the one that gives you Multicharts free as part of their package

All three are supported brokers from multicharts https://www.multicharts.com/brokers/

As well as hearing that MC can do this type of hedging, it stands to reason in my mind it should beable to handle these brokers orders ... MC is supporting them and the brokers are supporting MC

It may only be possible through 2 charts and having long and short orders separated

I was led to believe though that it can be done through the same chart and that's why i'm asking all you experts out there

Any help would be gratefully received

Mark :)

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Hedge - Same Instrument - EasyLanguage - Long and Short

Postby Dave Masalov » 31 Aug 2010

Dear Mark,

MultiCharts does not support hedging, so you cannot be long and short on one chart at the same time. However, you can set up two identical charts and sell on one while buying on the other.

mark-uk
Posts: 6
Joined: 16 Aug 2010

Re: Hedge - Same Instrument - EasyLanguage - Long and Short

Postby mark-uk » 31 Aug 2010

Absolutely Dave

Problem is though it doesn't allow for optimization of inputs, it produces two separate performance results

It would be great if MC could allow for this in the platform
It could be done on the basis of order names and if no order names are given then it operates as it is currently

if currentbar = 10 then buy ( "LE_Close" ) this bar at close ;
if currentbar = 20 then sellshort ( "SE_Close" ) this bar at close ;
if currentbar = 30 then sell ( "LX_Market" ) from entry ( "LE_Close" ) next bar at market ;
if currentbar = 40 then buytocover ( "SX_Market" ) from entry ( "SE_Close" ) next bar at market ;

This way separates out the long position orders from the short position orders
And it's already the way EL works, jus needs it's own flag like the pyramiding flag to switch it on and off

Shouldn't be too difficult to make this amendment to MC

If it happens please let me know

Mark :)


Return to “MultiCharts”