+1 888 340 6572
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
Closed Bug report MC-2229

Limit entry orders bug

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
icon_info.png This issue has been closed with status "Not a bug" and resolution "Not determined".
Description
Hi, entry limit orders will not fill if there are also Market orders created (even if unused). Example script below. No trades occur, unless the two lines that create the unused entry market orders are comment out (lines 24 and 25).

Version: MultiCharts .NET64 Version 10.0 Release (Build 14248)

Cheers, saltminer

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using ATCenterProxy.interop;
 
namespace PowerLanguage.Strategy 
{
	public class TestEntryLimitOrders : SignalObject 
	{
		public TestEntryLimitOrders(object _ctx):base(_ctx)
		{
 
		}
 
		private IOrderPriced entryLongOrder, entryShortOrder;
		private IOrderMarket exitLongOrder, exitShortOrder;
        private IOrderMarket entryLongMarketOrder, entryShortMarketOrder;
 
		protected override void Create() 
		{
			// create variable objects, function objects, order objects etc.
 
			entryLongMarketOrder = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "LEm", EOrderAction.Buy));
			entryShortMarketOrder = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SEm", EOrderAction.SellShort));
 
			entryLongOrder = OrderCreator.Limit(new SOrderParameters(Contracts.Default, "LEl", EOrderAction.Buy));
			entryShortOrder = OrderCreator.Limit(new SOrderParameters(Contracts.Default, "SEl", EOrderAction.SellShort));
 
			exitLongOrder = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "LX", EOrderAction.Sell));
			exitShortOrder = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SX", EOrderAction.BuyToCover));
		}
		protected override void StartCalc() 
		{
			// assign inputs 
		}
		protected override void CalcBar()
		{
			// strategy logic : if no position, entry at limit. If in a position, exit at market. 
			// this is to test entry limit order functionality.
 
			if (CurrentPosition.Side == EMarketPositionSide.Flat)
			{
				double price = Bars.Round2Fraction((Bars.HighValue + Bars.LowValue)/2);
				if (Bars.CurrentBar%2 == 0)
				{
					Output.WriteLine(Bars.TimeValue+" Long limit entry order placed at "+price);
					entryLongOrder.Send(price);
				}
				else 
				{
					Output.WriteLine(Bars.TimeValue+" Short limit entry order placed at "+price);
					entryShortOrder.Send(price);
				}
			}
			else 
			{
				if (CurrentPosition.Side == EMarketPositionSide.Long)
					exitLongOrder.Send();
				else 
					exitShortOrder.Send();
			}
		}
	}
}
Steps to reproduce this issue

Implement the attached script. Comment and uncomment lines 24 and 25 to swap behaviour.

Comments (1)
#1
user-offline.png  Alex MultiCharts (Alex MultiCharts)
May 10, 2017 - 11:54
We have tried to reproduce the issue on our end, but it was working with no issues with the provided code.

Please come to the Live Chat Mon-Fri from 6.30 AM to 11 AM EST to demonstrate the issue.
History
Issue basics
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 (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates