HotKeys

 avatar
EBTURK
plain_text
7 months ago
785 B
16
Indexable
Never
//+------------------------------------------------------------------+
//|                                                     OneClick.mq5 |
//|                                           Copyright 2023, EBTURK |
//|                                           https://www.ebturk.com |
//+------------------------------------------------------------------+
#include <Trade/Trade.mqh>
#define KEY_B 66
#define KEY_S 83
CTrade trade;

void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam)
   {
      if(id == CHARTEVENT_KEYDOWN){
         if(lparam == KEY_B){
            Print("BUY");
            trade.Buy(0.1);
         }
       if(lparam == KEY_S){
         Print("SELL");
         trade.Sell(0.1);
       }
      } 
   }