HomeSample Page

Sample Page Title


Product URL  : https://www.mql5.com/en/market/product/164533

Documentation of Bybit API URL: https://bybit-exchange.github.io/docs/v5/information

Tutorial 1 : Buying and selling Operations

Script Demo :

Word : As soon as you bought the Library, Will probably be discovered below Scripts/Market Folder






#property copyright "Copyright 2026, Rajesh Kumar Nait"
#property hyperlink      "https://www.mql5.com/en/customers/rajeshnait/vendor"
#property model   "1.00"
#property description "Uncomment code which is required"
#property strict

#embody <Customized/Crypto_Charting/JAson.mqh>
CJAVal jv(NULL, jtUNDEF);
struct BybitConfig {
   string            api_url;
   string            api_key;
   string            api_secret;
   string            api_suffix;
   string            class;
   bool              debug;
};

#import "..LibrariesLibrary_Bybit.ex4"
void Bybit_Init(BybitConfig &config);



string GetTime();



string Get_exchangeInfo();




string orderLimit(string image, string facet, double amount, double worth);
string orderAmend(string image, string orderId, double qty, double worth);




string orderMarket(string image, string facet, double amount);




string setTradingStop(string image, string slTrigger, string tpTrigger);




string orderMarket_Hedge (
   string image,
   string facet,          
   int    positionIdx,   
   double qty
);



string orderCancel(string image, string orderId);
string orderCancelAll(string image);



string orderRealtime(  string image, string orderId, string openOnly);
string orderHistory(   string image, string orderId, string execType, string startTime, string endTime, string cursor);
string tradeHistory(   string image, string orderId, string orderStatus, string startTime, string endTime, string cursor);



string getWalletBalance(string accountType);



string setLeverage(string image, string buyLeverage, string sellLeverage);




string getPosition(string image, string cursor);




string Get_Symbol_Price_Ticker(string image);

#import

bool Bybit_debug = true; 




string Bybit_Key     = "L51zfkjJZOCdF3ufip"; 
string Bybit_Secret  = "txnyks6V3dkyhUWWY64l5ay02B0V6V5MNNZa"; 

string Bybit_URL  = "https://api-testnet.bybit.com"; 
string Bybit_suffix = "/v5/"; 
string class = "linear"; 


BybitConfig config;




void OnStart() {


   config.api_url = Bybit_URL;
   config.api_key = Bybit_Key;
   config.api_secret = Bybit_Secret;
   config.api_suffix = Bybit_suffix;
   config.debug = Bybit_debug;
   config.class = class;

   Bybit_Init(config);







































































































 



  

  






























































































































































































































  }


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles