差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
mt4:重映射_mt4_的快捷键像同花顺一样 [2022/10/10 03:34] – 创建 wyrover | mt4:重映射_mt4_的快捷键像同花顺一样 [2022/10/10 05:07] (当前版本) – wyrover | ||
---|---|---|---|
行 1: | 行 1: | ||
# 重映射 MT4 的快捷键像同花顺一样 | # 重映射 MT4 的快捷键像同花顺一样 | ||
+ | |||
+ | 1. 需要写指标响应 `CHARTEVENT_KEYDOWN` 事件 | ||
+ | 2. 需要 Autohotkey 重映射快捷键 | ||
+ | |||
+ | 效果: | ||
+ | |||
+ | 1. **< | ||
+ | 2. **Ctrl+Left**/ | ||
+ | 3. **Up**/ | ||
+ | 4. **0** 键 还原图表坐标轴缩放 | ||
+ | 5. **P** 键 隐藏/ | ||
+ | 6. **M** 月线 **W** 周线 | ||
+ | |||
+ | ![](https:// | ||
+ | |||
+ | |||
+ | ## MT4 指标 | ||
**Symbol changer-hotkeys.mq4** | **Symbol changer-hotkeys.mq4** | ||
行 270: | 行 287: | ||
int keycode = int(lparam); | int keycode = int(lparam); | ||
+ | Print(keycode); | ||
- | + | | |
- | | + | |
currentIndex = (int)GlobalVariableGet(" | currentIndex = (int)GlobalVariableGet(" | ||
行 297: | 行 314: | ||
- | if (keycode == 34) { | + | if (keycode == 190) { |
currentIndex = (int)GlobalVariableGet(" | currentIndex = (int)GlobalVariableGet(" | ||
行 513: | 行 530: | ||
} | } | ||
// | // | ||
+ | |||
</ | </ | ||
+ | |||
+ | ## AHK 脚本 | ||
+ | |||
+ | **MT4.ahk** | ||
+ | |||
+ | <code cpp> | ||
+ | # | ||
+ | #NoEnv | ||
+ | # | ||
+ | DetectHiddenWindows, | ||
+ | SetTitleMatchMode, | ||
+ | SetTitleMatchMode, | ||
+ | SetWorkingDir %A_ScriptDir% | ||
+ | |||
+ | | ||
+ | |||
+ | ; | ||
+ | ; MT4 | ||
+ | # | ||
+ | |||
+ | Up:: | ||
+ | send {NumpadAdd} | ||
+ | return | ||
+ | |||
+ | Down:: | ||
+ | send {NumpadSub} | ||
+ | return | ||
+ | |||
+ | |||
+ | ^Left:: | ||
+ | send {PgUp} | ||
+ | return | ||
+ | |||
+ | |||
+ | ^Right:: | ||
+ | send {PgDn} | ||
+ | return | ||
+ | | ||
+ | |||
+ | # | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ## 脚本打包下载 | ||
+ | |||
+ | - [MT4-Symbol changer-hotkeys.7z](https:// |