Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
igotit-anything / gist:8ea565863984879eb41cbfa7f42c2ca8
Created April 28, 2026 03:47
Visual Studio 파일 인코딩 변환 . 한글깨짐 해결 . PowerShell 명령어
Get-ChildItem -Recurse -Include *.cpp, *.h, *.cs, *.hpp | ForEach-Object {
$filePath = $_.FullName
# 1. 파일의 첫 3바이트를 읽어 BOM 확인
$bytes = [System.IO.File]::ReadAllBytes($filePath)
$isUtf8Bom = $bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF
if ($isUtf8Bom) {
Write-Host "이미 UTF-8 BOM임 (건너뜀): $($_.Name)" -ForegroundColor Yellow
@igotit-anything
igotit-anything / CyAddOnInstrument.cs
Created January 17, 2026 11:54
Ninjascript AddOns Instrument Subscribe
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
@igotit-anything
igotit-anything / CyAddOnHelloNinja.cs
Last active January 17, 2026 08:46
ninja script
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
@igotit-anything
igotit-anything / CFixStatusDlg.cpp
Last active January 11, 2026 03:43
CDialogEx template
/// .h
#include "resource.h"
class CFixStatusDlg : public CDialogEx
{
DECLARE_DYNAMIC(CFixStatusDlg)
public:
explicit CFixStatusDlg(CWnd* pParent = nullptr);
/*
2025.11.25
파일명 : CyTool_Candle_2_Sqlite_Multi.mq5
여러 종목의 캔들 데이터를 SQLite DB 로 저장.
mt5 의 아무챠트에서 실행해도 사용자 입력에서 지정된 여러 심볼들의 과거 캔들 확보하여 DB 파일로 저장.
모든 심볼의 메타 데이터 테이블.
테이블명 : A_SymbolMeta
//@version=6
strategy("Simple SMA Cross Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// ───────────── Input Parameters ─────────────
fastLen = input.int(9, title="Fast MA Length")
slowLen = input.int(21, title="Slow MA Length")
takeProfit = input.float(2.0, title="Take Profit %", step=0.1)
stopLoss = input.float(1.0, title="Stop Loss %", step=0.1)
// ───────────── Indicators ─────────────
@igotit-anything
igotit-anything / OrderSend_PosiOpen_UntilSuccess.mqh
Last active April 8, 2025 13:02
OrderSend_PosiOpen_UntilSuccess.mqh
/*
2초간격으로 주문 재송신. 최대 60초동안 재시도해도 실패하면 포기
*/
int CCy_Order_Single::OrderSend_PosiOpen_UntilSuccess(ENUM_POSITION_TYPE em_posi_type , int minvol_x, double sl, double tp,string comment)
{
int attempt = 0;
#property indicator_chart_window // 지표표현 방식 : indicator_separate_window = 별도창 , indicator_chart_window = 캔들챠트에 표현
#property indicator_buffers 1 // 지표 버퍼수
//#property indicator_plots 1// 설정하지 않는 경우 상기 indicator_buffers 와 동일 수량 자동 할당됨.
#property indicator_color1 Yellow
// 지표 버퍼
double indi_buf_1[];
int OnInit()
////////// 파일들. 주로 클래스 정의들.
#include "../CySDK_MQL5/CCy_SIG_TrendFilter_1.mqh"
////////// 사용자 입력.
input ulong ui_magic_number = 9601;//Magic Number
/// 입력값들 수정전값 받아두는것.
ulong ui_magic_number_prev = ui_magic_number;
/*
CCy_AP909_TA_DB_Sqlite_1.mqh
2024.10.26
CyEA909 에서 활용되는 SQLite DB CyEA909.sqlite 핸들링.
- 종목별로 다른 정보(예 : 커미션)이면서 mql5 에서 함수 제공안되는 것들 처리위함.