How to change the decimal points / pips of a chart?

 

Hi,

For unknown reason when I run this offline chart, the EURUSD has 4 decimals only and make my program calculation not correct as 'Points' is 10 times more now. I copy all history files to another PC and the chart looks ok with 5 decimals. So how is this determined and where is it stored in a PC? I think it's in the contract specification, but I don't know where it is stored and how to change it. Thanks!

 
MarketInfo() MODE_DIGITS . . . the chart you posted is not an offline chart as far as I can see . . . if your Broker sets 4 digits for EURUSD then that is that, as far as I know.
 

How to change the decimal points / pips of a chart?

  1. Except for offline charts, you don't.
  2. Have your code automatically adjust
    //++++ These are adjusted for 5 digit brokers.
    int     pips2points;    // slippage  3 pips    3=points    30=points
    double  pips2dbl;       // Stoploss 15 pips    0.015      0.0150
    int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
    int     init(){                                             OptInitialization();
         if (Digits % 2 == 1){      // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262
                    pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
        } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
        // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
    //---- These are adjusted for 5 digit brokers.
        /* On ECN brokers you must open first and THEN set stops
        int ticket = OrderSend(..., 0,0,...)
        if (ticket < 0)
           Alert("OrderSend failed: ", GetLastError());
        else if (!OrderSelect(ticket, SELECT_BY_TICKET))
           Alert("OrderSelect failed: ", GetLastError());
        else if (!OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0)
           Alert("OrderModify failed: ", GetLastError());
         */
    

 

Let me demostrate more in another case.

1. Just open an offline chart with 5-digit.

2. Then load it with a standard ADX template (in fact any template will do)

3. Then the chart becomes 4-digit!!!

What's going on????? I have no idea at all and this is driving me crazy.

 

Nope . . . this is an Offline chart with the ADX template applied . . .

Perhaps your offline data is inherently 4 digit, have you looked at it in the History Center ?

 
RaptorUK:

Nope . . . this is an Offline chart with the ADX template applied . . .

Perhaps your offline data is inherently 4 digit, have you looked at it in the History Center ?


Hi Raptor, what do you mean by 'nope'? Mine is also an offline chart with ADX template applied.

How to view it in the History Center?

And no matter what, this happens in two of my virtual PC (Windows XP) only. The same data / offline chart in my Windows 7 doesn't have this problem.

I am wonder if this is related to the MT4 version. However the site has a slow download today and I am unable to upgrade my virtual PC to the same version that I have in Windows 7 yet.

 
lingwuchung:


1. Hi Raptor, what do you mean by 'nope'? Mine is also an offline chart with ADX template applied.

2. How to view it in the History Center?

3. And no matter what, this happens in two of my virtual PC (Windows XP) only. The same data / offline chart in my Windows 7 doesn't have this problem.

I am wonder if this is related to the MT4 version. However the site has a slow download today and I am unable to upgrade my virtual PC to the same version that I have in Windows 7 yet.

1. You said . . . "1. Just open an offline chart with 5-digit.
2. Then load it with a standard ADX template (in fact any template will do)"

I did just that, I still have 5 digits . . so Nope.

2. Be careful doing this . . you can mess things up, use at YOUR own risk ! ! Hit F2, double click EURUSD, double click M5, click Import, use Browse to navigate to your offline data .hst file . . . DO NOT CLICK OK now you can look at your data. When you are done looking . . click CANCEL

3. So you exported this data from your XP machine and imported it to your Windows 7 machine ? or did you just create it from scratch on your Windows 7 machine ? if you created it from scratch then it is NOT the same data . . .

 
RaptorUK:

1. You said . . . "1. Just open an offline chart with 5-digit.
2. Then load it with a standard ADX template (in fact any template will do)"

I did just that, I still have 5 digits . . so Nope.

2. Be careful doing this . . you can mess things up, use at YOUR own risk ! ! Hit F2, double click EURUSD, double click M5, click Import, use Browse to navigate to your offline data .hst file . . . DO NOT CLICK OK now you can look at your data. When you are done looking . . click CANCEL

3. So you exported this data from your XP machine and imported it to your Windows 7 machine ? or did you just create it from scratch on your Windows 7 machine ? if you created it from scratch then it is NOT the same data . . .

I see.

I xcopy/s all .hst from Windows 7 to XP. So the whole folder are exactly the same.

Let me try your instructions and see what will I see.

 
RaptorUK:

1. You said . . . "1. Just open an offline chart with 5-digit.
2. Then load it with a standard ADX template (in fact any template will do)"

I did just that, I still have 5 digits . . so Nope.

2. Be careful doing this . . you can mess things up, use at YOUR own risk ! ! Hit F2, double click EURUSD, double click M5, click Import, use Browse to navigate to your offline data .hst file . . . DO NOT CLICK OK now you can look at your data. When you are done looking . . click CANCEL

3. So you exported this data from your XP machine and imported it to your Windows 7 machine ? or did you just create it from scratch on your Windows 7 machine ? if you created it from scratch then it is NOT the same data . . .


heyyyyyyyyyy............

what's this file in the history folder? It seems to contain the number of digits for all the symbols.

 
RaptorUK:

1. You said . . . "1. Just open an offline chart with 5-digit.
2. Then load it with a standard ADX template (in fact any template will do)"

I did just that, I still have 5 digits . . so Nope.

2. Be careful doing this . . you can mess things up, use at YOUR own risk ! ! Hit F2, double click EURUSD, double click M5, click Import, use Browse to navigate to your offline data .hst file . . . DO NOT CLICK OK now you can look at your data. When you are done looking . . click CANCEL

3. So you exported this data from your XP machine and imported it to your Windows 7 machine ? or did you just create it from scratch on your Windows 7 machine ? if you created it from scratch then it is NOT the same data . . .


Hi Raptor,

I've solved it after I copy those *.raw in the history folder from my Windows 7 as well. Thanks for your guidance (to let me know something really weird is happening to me).

Btw, I follow your instruction about history center import. I didn't click "OK", but nothing happens.

 
lingwuchung:


Hi Raptor,

I've solved it after I copy those *.raw in the history folder from my Windows 7 as well. Thanks for your guidance (to let me know something really weird is happening to me).

Btw, I follow your instruction about history center import. I didn't click "OK", but nothing happens.

If the file is big you sometimes have to give it a few minutes to read . . . but it looks like you are trying to import it over M1 not M5 . . . look in the top left corner of the import window, it says Import, M1