Hi,
I just want to let you guys know that I am a 3rd party developer on another trading platform.
I was requested to branch out onto your platform by someone looking to private label your .NET platform.
To get a feel for your platform I took on two projects.
------------------------------------------------------------------------------------------------------
First, create an indicator that duplicates the time and sales window in the output window.
I needed Bid, Ask, and Trade data from the exchange in real time to make this happen.
I could not find this data on your platform. This project is at a standstill.
------------------------------------------------------------------------------------------------------
This led to project two. Build a Method that allows for easy access to the exchange data that updates in real time.
I am trying to use your dataloader to create this Method.
Here is the code so far.
Code: Select all
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using System.Collections.Generic;
namespace PowerLanguage.Indicator{
public class BidAskDataLoader : IndicatorObject
{
public BidAskDataLoader(object _ctx):base(_ctx){}
public delegate void LoadDataCallback(IDataLoaderResult Result);
private IDataLoaderResult iRes;
private IPlotObject plot1;
private IPlotObject m_spreadPlot;
protected override void Create() {
plot1 = AddPlot(new PlotAttributes("", EPlotShapes.Line, Color.Red));
m_spreadPlot = AddPlot(new PlotAttributes("", EPlotShapes.Line, Color.Red));
}
protected override void StartCalc() {
Output.Clear();
iRes = null;
InstrumentDataRequest Req = Bars.Request;
Req.Resolution = new Resolution { Size = 1, Type = EResolution.Tick };
Req.Subscribe2RT = true;
Req.Range = DataRequest.CreateBarsBack(DateTime.Now, 1);
Req.FilterOutOfRangeData = true;
Req.Subscribe2RT = true;
Req.QuoteField = RequestQuoteField.Trade;
// Request.Symbol = "CLEZ14";
DataLoader.BeginLoadData(Req, OnData, null);
Req.QuoteField = RequestQuoteField.Ask;
// Request.Symbol = "CLEZ14";
DataLoader.BeginLoadData(Req, OnData, null);
Req.QuoteField = RequestQuoteField.Bid;
// Request.Symbol = "CLE/Z14";
DataLoader.BeginLoadData(Req, OnData, null);
}
public void OnData(IDataLoaderResult Result)
{
if (Result.Request.QuoteField == RequestQuoteField.Ask)Output.WriteLine("Bars.StatusLine.Ask = {0}", RequestQuoteField.Ask );
if (Result.Request.QuoteField == RequestQuoteField.Bid)Output.WriteLine("Bars.StatusLine.Bid = {0}", RequestQuoteField.Bid );
if (Result.Request.QuoteField == RequestQuoteField.Trade)Output.WriteLine("Bars.StatusLine.Trade = {0}", RequestQuoteField.Trade );
Output.WriteLine("-------------------");
}
protected override void CalcBar(){
// indicator logic
plot1.Set(Bars.Close[0]);
}
}
}
Symbol fields are commented out because the symbols will not compile.
What are the correct symbol names for CL, TF, and ES?
Because I have never been to school to learn programming, I need a little help.
I know which updates are Bid, Ask, and Trade.
I do not know how to access the Price, Volume, and TimeStamp of each update from the exchange.
The platform I currently use provides a Method that has all this information that programmers can access in real time when the markets are open.
If possible, please provide code of a working example of how to access these updates from the exchange on this platform for the benefit of all coders here and please consider adding it to your platform as a standard feature in the future.
Thanks