mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-31 12:37:47 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b4adfaa97 |
@@ -72,6 +72,7 @@
|
|||||||
<Compile Include="MtOrder.cs" />
|
<Compile Include="MtOrder.cs" />
|
||||||
<Compile Include="MtQuote.cs" />
|
<Compile Include="MtQuote.cs" />
|
||||||
<Compile Include="MtQuoteEventArgs.cs" />
|
<Compile Include="MtQuoteEventArgs.cs" />
|
||||||
|
<Compile Include="MtSession.cs" />
|
||||||
<Compile Include="MtTimeBar.cs" />
|
<Compile Include="MtTimeBar.cs" />
|
||||||
<Compile Include="MtTypes.cs" />
|
<Compile Include="MtTypes.cs" />
|
||||||
<Compile Include="Monitors\TradeMonitor.cs" />
|
<Compile Include="Monitors\TradeMonitor.cs" />
|
||||||
@@ -90,6 +91,7 @@
|
|||||||
<Compile Include="Requests\OrderDeleteRequest.cs" />
|
<Compile Include="Requests\OrderDeleteRequest.cs" />
|
||||||
<Compile Include="Requests\OrderModifyRequest.cs" />
|
<Compile Include="Requests\OrderModifyRequest.cs" />
|
||||||
<Compile Include="Requests\OrderSendRequest.cs" />
|
<Compile Include="Requests\OrderSendRequest.cs" />
|
||||||
|
<Compile Include="Requests\SessionRequest.cs" />
|
||||||
<Compile Include="Requests\RequestBase.cs" />
|
<Compile Include="Requests\RequestBase.cs" />
|
||||||
<Compile Include="Requests\RequestType.cs" />
|
<Compile Include="Requests\RequestType.cs" />
|
||||||
<Compile Include="Responses\CopyRatesResponse.cs" />
|
<Compile Include="Responses\CopyRatesResponse.cs" />
|
||||||
@@ -97,6 +99,7 @@
|
|||||||
<Compile Include="Responses\GetOrdersResponse.cs" />
|
<Compile Include="Responses\GetOrdersResponse.cs" />
|
||||||
<Compile Include="Responses\ICustomResponse.cs" />
|
<Compile Include="Responses\ICustomResponse.cs" />
|
||||||
<Compile Include="Responses\OrderSendResponse.cs" />
|
<Compile Include="Responses\OrderSendResponse.cs" />
|
||||||
|
<Compile Include="Responses\SessionResponce.cs" />
|
||||||
<Compile Include="Responses\ResponseBase.cs" />
|
<Compile Include="Responses\ResponseBase.cs" />
|
||||||
<Compile Include="SeriesIdentifier.cs" />
|
<Compile Include="SeriesIdentifier.cs" />
|
||||||
<Compile Include="TimeBarArgs.cs" />
|
<Compile Include="TimeBarArgs.cs" />
|
||||||
|
|||||||
@@ -1422,6 +1422,12 @@ namespace MtApi
|
|||||||
var commandParameters = new ArrayList { name, (int)prop_id };
|
var commandParameters = new ArrayList { name, (int)prop_id };
|
||||||
return SendCommand<string>(MtCommandType.SymbolInfoString, commandParameters); ;
|
return SendCommand<string>(MtCommandType.SymbolInfoString, commandParameters); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtSession SymbolInfoSession(string symbol, DayOfWeek dayOfWeek, uint index, SessionType type)
|
||||||
|
{
|
||||||
|
var responce = SendRequest<SessionResponce>(new SessionRequest { Symbol = symbol, DayOfWeek = dayOfWeek, SessionIndex = (int)index, SessionType = type });
|
||||||
|
return responce != null ? responce.Session : null;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MtApi
|
||||||
|
{
|
||||||
|
public class MtSession
|
||||||
|
{
|
||||||
|
public string Symbol { get; set; }
|
||||||
|
public DayOfWeek DayOfWeek { get; set; }
|
||||||
|
public uint Index { get; set; }
|
||||||
|
public int MtFromTime { get; set; }
|
||||||
|
public DateTime From
|
||||||
|
{
|
||||||
|
get { return MtApiTimeConverter.ConvertFromMtTime(MtFromTime); }
|
||||||
|
}
|
||||||
|
public int MtToTime { get; set; }
|
||||||
|
public DateTime To
|
||||||
|
{
|
||||||
|
get { return MtApiTimeConverter.ConvertFromMtTime(MtToTime); }
|
||||||
|
}
|
||||||
|
public bool HasData { get; set; }
|
||||||
|
public SessionType Type { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SessionType { Quote, Trade }
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
OrderDelete = 6,
|
OrderDelete = 6,
|
||||||
OrderModify = 7,
|
OrderModify = 7,
|
||||||
iCustom = 8,
|
iCustom = 8,
|
||||||
CopyRates = 9
|
CopyRates = 9,
|
||||||
|
Session = 10,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace MtApi.Requests
|
||||||
|
{
|
||||||
|
public class SessionRequest : RequestBase
|
||||||
|
{
|
||||||
|
public string Symbol { get; set; }
|
||||||
|
public DayOfWeek DayOfWeek { get; set; }
|
||||||
|
public int SessionIndex { get; set; }
|
||||||
|
public SessionType SessionType { get; set; }
|
||||||
|
|
||||||
|
public override RequestType RequestType
|
||||||
|
{
|
||||||
|
get { return RequestType.Session; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace MtApi.Responses
|
||||||
|
{
|
||||||
|
public class SessionResponce : ResponseBase
|
||||||
|
{
|
||||||
|
public MtSession Session { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user