How to execute a script only once?

 
#include<Trade\Trade.mqh>

CTrade trade;

void OnTick()
   {
      trade.Buy()
   }

What do I need to add/change to the code above so that it executes a buy order only once after I run the EA? I'm only newbie. Thanks!

 
#include <Trade\Trade.mqh>
CTrade Trade;

void OnInit()
{
     Trade.SetMarginMode();
     Trade.SetDeviationInPoints(5);
     Trade.SetTypeFillingBySymbol(_Symbol);
     Trade.SetExpertMagicNumber(12345);
     Trade.LogLevel(LOG_LEVEL_ERRORS);
     
     // bool Buy(const double volume,const string symbol=NULL,double price=0.0,const double sl=0.0,const double tp=0.0,const string comment="");
     if( !Trade.Buy(0.1, _Symbol, SymbolInfoDouble(_Symbol,SYMBOL_ASK)) )
          Print( "Could not take BUY position" );
}
Buy
 
Konstantin Nikitin:
Buy
Thank you, worked perfectly!