why it cannot be sell or buytocover partially?  [SOLVED]

Questions about MultiCharts and user contributed studies.
kiyi0317
Posts: 40
Joined: 13 Apr 2016
Has thanked: 17 times
Been thanked: 1 time

why it cannot be sell or buytocover partially?

Postby kiyi0317 » 28 Oct 2016

I using MC+IB. I would like to sell / buytocover partially, but it seems not workable for below. pls help.

the similar same coding on buy and sellshort, those works smoothly.

Code: Select all

buy 2 contracts next bar at market;
sellshort 2 contracts next bar at market;
both buy and sellshort are workable and smoothly. When data1 close and conditions are match, then orders will be submit. After that when data1 close again, and if conditions are still match, another 2 contracts order will be submit.

but on the other hand, it is not workable for exit market.

Code: Select all

buytocover 2 contracts next bar at market;
sell 2 contracts next bar at market;
when data1 close and buytocover / sell conditions are match, the signal will submit the orders at once.
for example, when the system already sell and hold 10 contracts, I would like to close 2 contracts once conditions are match. but the signal just submit a 2 contracts order only one time. Even the new coming data1 bar close and those conditions are match, no orders will be submit!! then I still sell and hold 8 contracts. anything wrong with my coding? any comments and help is appreciate.
Last edited by kiyi0317 on 28 Oct 2016, edited 1 time in total.

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

Re: why it cannot be sell or buytocover partially?

Postby TJ » 28 Oct 2016

See posts #1 and #2
viewtopic.php?f=16&t=11713

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

Re: why it cannot be sell or buytocover partially?  [SOLVED]

Postby TJ » 28 Oct 2016

Have you try a search in this forum of the word "partial" ?
There are previous discussions on the topic.

If you need coding help,
you will need to post your code.


What is the symbol?
How many data stream?
What are the chart resolutions?


Return to “MultiCharts”