Download MetaTrader 5
To add comments, please log in or register
Share your knowledge. Become a well-known developer!
Musngi
281
Musngi 2016.10.07 17:15 

[Indicator] How do you get the current changes in Price/Pips/Ticks in Multi-TimeFrame & Symbol? 

  • I used 'Bid' but I don't know if this is the CORRECT/BEST WAY to get the current changes in Pips/Price/Ticks. I have no idea how can I use 'Bid' to display the current price in Multi-TimeFrame & Symbols.
  • Is there any function() for this task? I'm started to learn MQL4 to create a sophisticated Indicators.
  • I want to know if Price, Pips, Ticks are the same?
Keith Watford
Moderator
8026
Keith Watford 2016.10.07 23:05  

MarketInfo()

iClose()

SymbolInfoTick()

Musngi
281
Musngi 2016.10.08 06:28  
GumRai:

MarketInfo()

iClose()

SymbolInfoTick()

  • Which are the best? I want faster, accurate function.
  • Should I use 'Bid' or 'Ask' to get current price/tick? 
  • I'm confused because there's Bid and Ask in MarketInfo() and SymbolInfoTick() to get the current price/tick?  
  • Is that how we get the current price/tick of a current bar? 
  • Can I get current price/tick of a current bar in iClose() function. iClose() its sound like closing price of a previous bar. 
  • Can you explain more how to use correctly this MarketInfo(), iCloser(), SymbolInfoTick().
Keith Watford
Moderator
8026
Keith Watford 2016.10.08 06:54  

I don't know which is fastest

   MqlTick last_tick;
   if(!SymbolInfoTick(sym,last_tick))
     {
      Print("SymbolInfoTick() failed, error = ",GetLastError());
      //
      //return;
     }
   int dig=(int)SymbolInfoInteger(sym,SYMBOL_DIGITS);
   double pt=SymbolInfoDouble(sym,SYMBOL_POINT);
   if(cmd==OP_BUY)
     {
      ord_num=OpenBuy(sym,cmd,last_tick.ask,LotSize1,0,0,com);
      if(ord_num>0)
        {
         //Do something
        }

This is a bit of my recent code where I used SymbolInfoTick()

Can I get current price/tick of a current bar in iClose() function. iClose() its sound like closing price of a previous bar.


iClose on the current bar returns the most recent price.
/
To add comments, please log in or register