Where can I find the StopPrice/LimitPrice of IOrderPriced ?  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
mystrader
Posts: 2
Joined: 07 Mar 2013

Where can I find the StopPrice/LimitPrice of IOrderPriced ?

Postby mystrader » 07 Mar 2013

Hello,

After "my_Order.Send(Entry_Price, Quant);" (whith "my_Order" a valid IOrderPriced), how can I find the price value the order has been sent to ?
Last edited by mystrader on 11 Mar 2013, edited 1 time in total.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Wherer can I find the StopPrice/LimitPrice of IOrderPric  [SOLVED]

Postby Henry MultiСharts » 08 Mar 2013

Hello mystrader,

Do you mean you need to get "Generated" and "Filled\Canceled" values from Order and position tracker? This functionality has been added to TradeManager.Order in MultiCharts .NET 8.5 Release Candidate. Please make sure you are running this version for accessing this functionality.
Here is a sample code for using it:

Code: Select all

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using ATCenterProxy.interop;
using PowerLanguage.TradeManager;
using ATCenterProxy;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;


namespace PowerLanguage.Strategy {
public class Test_HistoryOrdersLookUp : SignalObject
{
public Test_HistoryOrdersLookUp(object _ctx):base(_ctx){}

protected override void Create()
{
}

protected override void StartCalc()
{
Output.Clear();
}

bool subscribed = false;

protected override void CalcBar()
{
if (!subscribed)
{
TradeManager.TradingData.Orders.FinishChanging += new EventHandler( Orders_FinishChanging );
subscribed = true;
}

if (Bars.CurrentBar == 1)
{
TradeManager.TradingData.Orders.IntervalFltr.From = DateTime.Now.AddDays(-20);
TradeManager.TradingData.Orders.ProfileFltr.CurrentValue = "CQG";
}

TradeManager.ProcessEvents();
}

void Orders_FinishChanging( object sender, EventArgs e )
{
TradeManager.IOrders ord = sender as TradeManager.IOrders;
Output.WriteLine("Data Count = {0}", ord.Items.Length);
foreach (TradeManager.Order o in ord.Items)
{
Output.WriteLine( "Order Profile = {0}, Order ID = {1} , ExecPrice = {2}, Generated = {3}, Filled\\Canceled = {4} ",
o.Profile, o.ID, o.ExecPrice, o.GeneratedDT, o.FinalDT.Value);
}
}
}
}

mystrader
Posts: 2
Joined: 07 Mar 2013

Re: Where can I find the StopPrice/LimitPrice of IOrderPrice

Postby mystrader » 11 Mar 2013

Thank you for your answer. I am waiting for the official release to jump to v8.5 but I think it is what i am looking for


Return to “MultiCharts .NET”