What is a TICK? - page 2

 

OK, Great topic !!!!

then What is Volume? the count of tick change times, or the the count of trades times, or amount of trade fund in a period ?

 

To restate:

My basic finding is if there is a change in MarketInfo() for the pair, a "tick" is received.

.

There may be exceptions, like "no changes found" but a tick was received, but it is very rare.

Ticks received with no price change are not rare, and signal some other change in MarketInfo for the pair.

.

Volume is equal to the number of ticks received, i.e. the number of times the start() function was called, it is not specifically trades or Bid/Ask changes. Change in MarketInfo()triggers a tick, and tick count = volume.

 
phy:

.

Volume is equal to the number of ticks received, i.e. the number of times the start() function was called.


Yes, but some ticks may be missed (the start() function was not called) because previous start() still not complete.

At incoming of new quotes, the start() function of the attached experts and custom indicators will be executed. If the start() function launched at the preceding quote was running when a new quote came, the new quote will be skipped by the expert. All new quotes income while the program was being executed are skipped by the program until the current execution of the start() function has been completed. After that, the start() function will be run only when a successive new quote incomes. For custom indicators, the start() function will be launched for recalculation after the current chart symbol or timeframe has been changed independently on new quotes incoming. The start() function will not be run when the expert properties window is open. The latter cannot be opened during the expert execution.

 

I'm not using the Start() function to trigger, I am using a script with an endless loop to examine MarketInfo().

I will rewrite the script, since the experiment has taken an unexpected direction.

.


//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+


    double oldBid, oldAsk, oldVolume, oldCheckSum, oldTickValue, oldSpread, oldMarginRequired;
    int oldTime;
    int tickValueChange;
    int checkSumCount = -2;
    double checkSum;

int start()
  {

   oldBid = Bid;
   oldAsk = Ask;
   oldVolume = Volume[0];
   oldTime = Time[0];
   oldCheckSum         = GetCheckSum();
   oldTickValue         = MarketInfo(Symbol(), MODE_TICKVALUE);
   oldSpread             = MarketInfo(Symbol(),MODE_SPREAD);  
   oldMarginRequired     = MarketInfo(Symbol(),MODE_MARGINREQUIRED);
   
   int bidChange, askChange, eitherChange, neitherChange, bothChange, tickCount, spreadChange, marginChange;

    while(!IsStopped()){

       RefreshRates();
       if(oldVolume != Volume[0]) tickCount += 1;
       if(oldBid != Bid && oldAsk == Ask) bidChange += 1;
       if(oldAsk != Ask && oldBid == Bid) askChange += 1;   
       if(oldBid != Bid && oldAsk != Ask) bothChange += 1;
       if(oldBid == Bid && oldAsk == Ask && oldVolume != Volume[0]){
           if     (oldTickValue != MarketInfo(Symbol(), MODE_TICKVALUE)) tickValueChange +=1;
           else if(oldSpread != MarketInfo(Symbol(),MODE_SPREAD)) spreadChange += 1;
           else if(oldMarginRequired != MarketInfo(Symbol(),MODE_MARGINREQUIRED)) marginChange += 1;
           else neitherChange += 1;
       }
       
       GetCheckSum();
       
       Comment("\n"+
                   " Bid Change              = " + bidChange + "\n" +
                   " Ask Change             = " + askChange + "\n" +
                   " Both Change            = " + bothChange + "\n" +
                   " MarketInfo Change  = " + checkSumCount + "\n" +
                      " TickValueChange     = " + tickValueChange + "\n" +
                      " Margin Change        = " + marginChange + "\n" +
                      " Spread Change        = " + spreadChange + "\n" +
                   " No Change              = " + neitherChange + "\n" +
                   //" Checksum           = " + checkSum + "\n" +
                   " Sum of above          = " + (bidChange + askChange + bothChange + spreadChange + neitherChange + checkSumCount +tickValueChange) + "\n" +
                   " Tick Volume            = " + tickCount);
                   
       Sleep(16);
                   
        oldVolume = Volume[0];
        oldBid = Bid;
        oldAsk = Ask;
        
    
    }


   return(0);
  }

double    GetCheckSum(){


    checkSum =
         
   (100*MarketInfo(Symbol(),MODE_LOW)) +
   (101*MarketInfo(Symbol(),MODE_HIGH)) +
   //(102*MarketInfo(Symbol(),MODE_TIME)) +
   //(103*MarketInfo(Symbol(),MODE_BID)) +
   //(104*MarketInfo(Symbol(),MODE_ASK)) +
   (105*MarketInfo(Symbol(),MODE_POINT)) +
   (106*MarketInfo(Symbol(),MODE_DIGITS)) +
   //(107*MarketInfo(Symbol(),MODE_SPREAD)) +
   (108*MarketInfo(Symbol(),MODE_STOPLEVEL)) +
   (109*MarketInfo(Symbol(),MODE_LOTSIZE)) +
   //(110*MarketInfo(Symbol(),MODE_TICKVALUE)) +
   (111*MarketInfo(Symbol(),MODE_TICKSIZE)) +
   (112*MarketInfo(Symbol(),MODE_SWAPLONG)) +
   (113*MarketInfo(Symbol(),MODE_SWAPSHORT)) +
   (114*MarketInfo(Symbol(),MODE_STARTING)) +
   (115*MarketInfo(Symbol(),MODE_EXPIRATION)) +
   (116*MarketInfo(Symbol(),MODE_TRADEALLOWED)) +
   (117*MarketInfo(Symbol(),MODE_MINLOT)) +
   (118*MarketInfo(Symbol(),MODE_LOTSTEP)) +
   (119*MarketInfo(Symbol(),MODE_MAXLOT)) +
   (120*MarketInfo(Symbol(),MODE_SWAPTYPE)) +
   (121*MarketInfo(Symbol(),MODE_PROFITCALCMODE)) +
   (122*MarketInfo(Symbol(),MODE_MARGINCALCMODE)) +
   (123*MarketInfo(Symbol(),MODE_MARGININIT)) +
   (124*MarketInfo(Symbol(),MODE_MARGINMAINTENANCE)) +
   (125*MarketInfo(Symbol(),MODE_MARGINHEDGED)) +
   //(126*MarketInfo(Symbol(),MODE_MARGINREQUIRED)) +
   (127*MarketInfo(Symbol(),MODE_FREEZELEVEL));

    if(checkSum != oldCheckSum) checkSumCount += 1;
    
    oldCheckSum = checkSum;
    
    return(checkSumCount);
}
 

Ticks received with price change or no price change, tick count = volume.

But Client MT maybe not received ALL Ticks for some reaseons like net break temporarily some seconeds.

then tick count = volume is it count or change times on server. or defined by broker want to change its price how much times in a period.

Is that right ?

For a broker take part in market to hedge it clients teade positions, Volume, it is also defined by broker want to change its price how muvh times in a period.

My God !

How to use the volume data ?

 

Questions on Marketinfo().

Will excessive Marketinfo() calls in an endless loop be considered spam by the Broker?

What would Not be considered spam?

How often can you execute Marketinfo() and not upset the Broker?

Does the Marketinfo() command pull from the Brokers cache, or is it a real requote??

Thanks

 

MarketInfo() calls do not go to the Dealer, it reads the most recent values already received from the dealer.

Calls to the Dealer will require about 100-300 milliseconds each to complete.

// script
int start(){
  
   int startTime = GetTickCount();  
   for(int i = 0; i < 10000; i++){   
      int spread = MarketInfo(Symbol(), MODE_SPREAD);  
   }   
   int endTime = GetTickCount();   
   Print("Time to collect 10000 instances of data = " + (endTime -startTime) + " milliseconds");  
   
   startTime = GetTickCount();  
   OrderSend(Symbol(), OP_BUY, 1, Ask, 0, 0, 0 , "", 0, 0, CLR_NONE);
   endTime = GetTickCount();   
   Print("Time to send one order to Server = " + (endTime -startTime) + " milliseconds");  
   return(0);
}
 
2008.10.27 16:32:37 Test GBPJPY,M15: Time to send one order to Server = 531 milliseconds
2008.10.27 16:32:37 Test GBPJPY,M15: open #8556064 buy 1.00 GBPJPY at 144.77 ok
2008.10.27 16:32:37 Test GBPJPY,M15: Time to collect 10000 instances of data = 438 milliseconds
 
GREAT TOPIC!!! UP
 

Phy - sorry to open this topic again :-)

I'm thinking that there is a mis-match between what you believe about the nature of a tick and your method of calculating profit/risk etc. (from reading some previous posts).

That is that you use MarketInfo(Symbol(),MODE_TICKVALUE) on its own in order to determine the pip value of the pair expressed in terms of the deposit currency.

However, if what you believe about ticks in MT4 is correct, then the tick value can change by a factor of the number of pips between ticks.

In other words, if the price suddenly jumps a couple of pips, a prior call to MarketInfo could reveal that TICKSIZE and TICKVALUE are 0.0001 and 7.16 respectively. Then the next call could return 0.0002 and 14.32.

In this case you would always have factor both MarketInfo(Symbol(),MODE_TICKSIZE) and MarketInfo(Symbol(),MODE_TICKVALUE) into your profit/risk formulae and never MarketInfo(Symbol(),MODE_TICKVALUE) on its own.

Is this accurate?


CB

 
MODE_TICKVALUE 16 Tick value in the deposit currency.
MODE_TICKSIZE 17 Tick size in the quote currency.

.

For Euro at MBTrading:

10000 MODE_LOTSIZE Lot size in the base currency.
0.1 MODE_TICKVALUE Tick value in the deposit currency.
0.00001 MODE_TICKSIZE Tick size in the quote currency.

.

Replace the word "tick" with "pip" above, if you like.

.

This broker uses mini-lot as standard size -- MODE_LOTSIZE

They use 3/5 digits for price -- MODE_TICKSIZE

Value of one of those "ticks" is $0.10 -- MODE_TICKVALUE

.

For GBPAUD:

.

10000 MODE_LOTSIZE Lot size in the base currency.
0.080262 MODE_TICKVALUE Tick value in the deposit currency.
0.00001 MODE_TICKSIZE Tick size in the quote currency.

.

GBPAUD single pip move on one lot pays $0.080262

.

Your idea for computing the price change of your order fom one moment to the next...

PositionValueChange = PriceChangeInPips * MarketInfo( OrderSymbol(), MODE_TICKVALUE) * OrderLots();

.

MB Trading Futures, Inc.
MBTrading-Demo Server

MB Trading Futures, Inc.
MBT MetaTrader 4
D:\Program Files (x86)\MetaTrader\MBT MetaTrader 4
/reports/MarketInfo_MB Trading Futures, Inc._.txt
2009.07.15 16:47:49



Report for EURUSD

1.39775     MODE_LOW                Low day price. 
1.41344     MODE_HIGH               High day price. 
2009.07.15 16:47:48     MODE_TIME               The last incoming tick time (last known server time). 
1.41044     MODE_BID                Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid 
1.41054     MODE_ASK                Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask 
0.00001     MODE_POINT              Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point 
5     MODE_DIGITS             Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits 
10     MODE_SPREAD             Spread value in points. 
0     MODE_STOPLEVEL          Stop level in points. 
10000     MODE_LOTSIZE            Lot size in the base currency. 
0.1     MODE_TICKVALUE          Tick value in the deposit currency. 
0.00001     MODE_TICKSIZE           Tick size in the quote currency. 
-0.6     MODE_SWAPLONG           Swap of the long position. 
-2.4     MODE_SWAPSHORT          Swap of the short position. 
0     MODE_STARTING           Market starting date (usually used for futures). 
0     MODE_EXPIRATION         Market expiration date (usually used for futures).
1     MODE_TRADEALLOWED       Trade is allowed for the symbol. 
0.1     MODE_MINLOT             Minimum permitted amount of a lot. 
0.1     MODE_LOTSTEP            Step for changing lots. 
10000     MODE_MAXLOT             Maximum permitted amount of a lot. 
2     MODE_SWAPTYPE           Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
0     MODE_PROFITCALCMODE     Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures. 
0     MODE_MARGINCALCMODE     Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
0     MODE_MARGININIT         Initial margin requirements for 1 lot. 
0     MODE_MARGINMAINTENANCE  Margin to maintain open positions calculated for 1 lot.
0     MODE_MARGINHEDGED       Hedged margin calculated for 1 lot. 
141.05     MODE_MARGINREQUIRED     Free margin required to open 1 lot for buying. 
0     MODE_FREEZELEVEL        Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed. 

Report for GBPAUD
2.04     MODE_LOW                Low day price. 
2.06095     MODE_HIGH               High day price. 
2009.07.15 16:47:42     MODE_TIME               The last incoming tick time (last known server time). 
2.04538     MODE_BID                Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid 
2.04588     MODE_ASK                Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask 
0.00001     MODE_POINT              Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point 
5     MODE_DIGITS             Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits 
50     MODE_SPREAD             Spread value in points. 
0     MODE_STOPLEVEL          Stop level in points. 
10000     MODE_LOTSIZE            Lot size in the base currency. 
0.080262     MODE_TICKVALUE          Tick value in the deposit currency. 
0.00001     MODE_TICKSIZE           Tick size in the quote currency. 
-1.47     MODE_SWAPLONG           Swap of the long position. 
-3.65     MODE_SWAPSHORT          Swap of the short position. 
0     MODE_STARTING           Market starting date (usually used for futures). 
0     MODE_EXPIRATION         Market expiration date (usually used for futures).
1     MODE_TRADEALLOWED       Trade is allowed for the symbol. 
0.1     MODE_MINLOT             Minimum permitted amount of a lot. 
0.1     MODE_LOTSTEP            Step for changing lots. 
10000     MODE_MAXLOT             Maximum permitted amount of a lot. 
2     MODE_SWAPTYPE           Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
0     MODE_PROFITCALCMODE     Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures. 
0     MODE_MARGINCALCMODE     Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
0     MODE_MARGININIT         Initial margin requirements for 1 lot. 
0     MODE_MARGINMAINTENANCE  Margin to maintain open positions calculated for 1 lot.
0     MODE_MARGINHEDGED       Hedged margin calculated for 1 lot. 
164.21     MODE_MARGINREQUIRED     Free margin required to open 1 lot for buying. 
0     MODE_FREEZELEVEL        Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.