일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- Upbit API
- c# api호출
- c# websocket
- 나만의 사이트모음집
- upbit
- Chart
- c# 차트
- 즐겨찾기
- XAML
- Prism
- 차트
- 업비트 API
- c# 라이브 차트
- maui
- 업비트 c#
- 북마크
- 업비트
- C#
- WPF
- c# restapi 호출
- c# 업비트 api키 목록
- c# 업비트
- c# restapi
- 라이브 차트
- 업비트 차트
- c# maui
Archives
- Today
- Total
하아찡
[C#/WPF/수정] Upbit 프로젝트 Chart 매수 매도 선 추가 본문
프로그램 내부에서 주문했을때
외부 기기에서 주문했을때
추가 및 변경 코드
private void GetOrderList() { GetOrderList(true); }
private void GetOrderList(bool b)
{
if(Market != "")
{
Order Orderfnc = new Order();
List<OrderList> list = Task.Run(() => Orderfnc.OrderListAsync(Market, "wait")).Result;
int cnt = PrintChartYAxis.Count;
if (cnt >= 5)
{
for (int i = 5; i < cnt; i++)
{
PrintChartYAxis.RemoveAt(5);
}
}
foreach(var item in list)
{
ChartSideCursor i = new ChartSideCursor();
i.X = 0;
i.Type = item.side;
i.CursorValue = item.price;
i.BackColor = item.side == "bid" ? MyColors.ColorChartOrderBid : MyColors.ColorChartOrderAsk;
i.Color = item.side == "bid" ? MyColors.ColorChartOrderBidText : MyColors.ColorChartOrderAskText;
double value = Convert.ToDouble(i.CursorValue);
if (value >= 0)
{
double yvalue = (GridHeight * ((MaxPrice - value) / (MaxPrice - MinPrice))) + GapYAxis;
//차트 범위 초과했을경우 안보이게 수정
if (GridHeight <= yvalue || 0 >= yvalue)
yvalue = -100;
i.Y = yvalue;
}
else
{
i.Y = -100;
}
PrintChartYAxis.Add(i);
}
}
}
/// <summary>
/// 해당 코인이 보유중일경우 차트에 출력.
/// 23.12.08
/// </summary>
private void GetCoinPrice()
{
if (Market == "")
return;
if (PrintChartYAxis[(int)YAxis.Avg].Y <= 0)
{
UpbitFunctions.Accounts FAccount = new UpbitFunctions.Accounts();
double price = FAccount.GetAccountCoinPrice(Market);
PrintChartYAxis[(int)YAxis.Avg].CursorValue = price.ToString();
}
for(int i = (int)YAxis.Avg; i < PrintChartYAxis.Count; i++)
{
if (PrintChartYAxis[i].Type == "bid" || PrintChartYAxis[i].Type == "ask" || PrintChartYAxis[i].Type == "AvgPrice")
{
double value = Convert.ToDouble(PrintChartYAxis[i].CursorValue);
if (value >= 0)
{
double yvalue = (GridHeight * ((MaxPrice - value) / (MaxPrice - MinPrice))) + GapYAxis;
//차트 범위 초과했을경우 안보이게 수정
if (GridHeight <= yvalue || 0 >= yvalue)
yvalue = -100;
PrintChartYAxis[i].Y = yvalue;
}
else
{
PrintChartYAxis[i].Y = -100;
}
}
}
}
반응형
'C# > 코인프로그램 - 코드' 카테고리의 다른 글
[C#/WPF] Login 프로젝트 SingUp (1) | 2023.12.12 |
---|---|
[C#/WPF] Login 프로젝트 LoginMain (0) | 2023.12.12 |
[C#/WPF/수정] Upbit프로젝트 Balance 타이머 추가 (1) | 2023.12.08 |
[C#/WPF/수정] PublicColor프로젝트 색변경 추가 (2) | 2023.12.06 |
[C#/WPF/수정] Upbit프로젝트 Balance (2) | 2023.12.05 |