+1 888 340 6572 GET STARTED
MultiCharts Project Management
previous_open_issue.png
Go to the previous open issue
previous_issue.png
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
bug_report_small.png
Open Bug report MC-2916

A EOrderAction.Sell w/ UserSpecified Contracts, submitted for 15 lots - will shave 15 lots from EACH order submission

action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
next_issue.png
Go to the next issue (open or closed)
next_open_issue.png
Go to the next open issue
Description

Having a for the SAME instrument (1 ticker, under 1 portfolio strategy, with PositionLimits=Allow-up-to-65000 regardless of who submits it):

longEOrder = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));

you may submit .Send() multiple times - with or without the same label, with or without the same lots-size.

But essentially, all the above submissions add up to the SAME position for ticker X ... you can pull with CurrentPosition.Value.

When you submit a sell defined as:

longXOrder = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Sell));

with a simple: longXOrder.Send(oNameSort, 15);

you expect CurrentPosition.Value to be deducted with 15. Instead, what happens is - every long submission (every long .SEND() command sent from longEOrder ) is deducted with 15.

Steps to reproduce this issue

Having:

        if (Bars.CurrentBar == 100) { lots = 20; longEOrderA.Send(oNameLong, lots); isSendingOrder = true; oName = oNameLong; }
        if (Bars.CurrentBar == 150) { lots = 10; longEOrderA.Send(oNameLong, lots); isSendingOrder = true; oName = oNameLong; }
        if (Bars.CurrentBar == 200) { lots = 20; longEOrderB.Send(oNameLong+"B", lots); isSendingOrder = true; oName = oNameLong; }
        if (Bars.CurrentBar == 250) { lots = 20; longEOrderA.Send(oNameLong, lots); isSendingOrder = true; oName = oNameLong; }

        if (Bars.CurrentBar == 300) 
        { 
            lots = 15;
            longXOrder.Send(oNameSort, lots); 
            isSendingOrder = true; 
            oName = oNameSort; 
        }

produces:

AdjustLotsFrom_mm:CalcBar, BarN: 100, Date: 2020-08-05, MkPos: 0, order LongA sent for lots: 20
AdjustLotsFrom_mm:CalcBar, BarN: 150, Date: 2020-10-15, MkPos: 20, order LongA sent for lots: 10
AdjustLotsFrom_mm:CalcBar, BarN: 200, Date: 2020-12-28, MkPos: 30, order LongA sent for lots: 20
AdjustLotsFrom_mm:CalcBar, BarN: 250, Date: 2021-03-11, MkPos: 50, order LongA sent for lots: 20
AdjustLotsFrom_mm:CalcBar, BarN: 300, Date: 2021-05-21, MkPos: 70, order SortA sent for lots: 15

AdjustLotsFrom_mm:CalcBar, LastBarOnChart: 1022, Date: 2024-04-05, MkPos: 15, order sent for lots: 0

Comments (1)
#1
user-offline.png  MultiCharts Support (MultiCharts)
Apr 08, 2024 - 11:46
Hello,

That’s expected behaviour.

Please see the Total description: https://www.multicharts.com/trading-software/index.php?title=Total
Changes:
  •   icon_status.pngStatus changed: Under Review => Not a bug
History
Issue basics
  • Type of issue
    Bug report
  • Category
    Not determined
  • Targeted for
    Not determined
  • Status
    Not a bug
  • Priority
    Not determined
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
Attachments (1)
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates