Order Not placed - Code Executed

Questions about MultiCharts .NET and user contributed studies.
lordsriram
Posts: 20
Joined: 03 Dec 2018

Order Not placed - Code Executed

Postby lordsriram » 09 Dec 2020

Here is a snippet of the code that is having execution issue

Code: Select all

m_CloseBull = OrderCreator.Limit(new SOrderParameters(Contracts.UserSpecified, "CloseBull", EOrderAction.Sell));
If a certain profit taking condition is met

I execute the following code

Code: Select all

m_CloseBull.Send(Bars.Close[0] - trailLimit, Convert.ToInt32(CurrentPosition.OpenLots * percentCloseSize));
and this places an order. In this example trailliit = 0.06 and perent closesize = 0.90

After this order is executed and atleast a few bars later, if my exit is triggered, I place the following statement

Code: Select all

m_CloseBull.Send(Bars.Close[0] - trailLimit, CurrentPosition.OpenLots);
This never places an order. I have an email alert when this code is executed and I get the alert every tick. I have the following settings

Code: Select all

[IOGMode(IOGMode.Enabled)] [SkipIdenticalTicks(true)] [UpdateOnEveryTick(true)] [SameAsSymbol(true)]
Can you please provide the reason for trade execution issue. I have the same code in another strategy and it executes correctly. I am unable to find the reason for that order to execute and not this one.

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: Order Not placed - Code Executed

Postby Svetlana MultiCharts » 16 Dec 2020

Hi lordsriram,

Please reproduce the situation in simplified environment (one workspace, one chart, simplified signal) and send us the following files to our support email so that we would be able to investigate it:

1. The workspace where the behaviour is reproduced.
2. Export of used symbols (with data) from QuoteManager in .qmd archive.
3. The exported scripts with all dependent functions that are used on the workspace.
4. The screenshots demonstrating the situation.
5. Step-by-step instruction how to reproduce the situation. Exact time when you expect the order to be generated.
6. MultiCharts Logs, collected via Feedback application, when the issue is reproduced.
7. Outputs of PowerLanguage Editor, where we could see, that the script has generated the order and it is not processed by MC correctly.


Return to “MultiCharts .NET”