How do I display the pip?

 

I would like to display the pip of symbol.

i want to know how i look at the screen to apply. However, Without specifying symbol in code

Is there any way to judge what is symbol pip(0.0001) automatically?

 
cjwhscjw:

I would like to display the pip of symbol.

i want to know how i look at the screen to apply. However, Without specifying symbol in code

Is there any way to judge what is symbol pip(0.0001) automatically?

  1. Your question doesn't make sense. A pip is a unit of measure (the price has moved 5 pips in 3 minutes). You can't display a pip of symbol any more than you can display quarts (with out having bottles.)
  2. Looking at the screen has nothing to do with code.
  3. On a 4 digit broker a point = pip. On a 5 digit broker a point = 1/10 pip.
    //++++ These are adjusted for 5 digit brokers.
    int     pips2points;    // slippage  3 pips    3=points    30=points
    double  pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
    int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
    int     init(){
         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(...)
        if (ticket < 0)
           Alert("OrderSend failed: ", GetLastError());
        else if (!OrderSelect(ticket, SELECT_BY_POS))
           Alert("OrderSelect failed: ", GetLastError());
        else if (!OrderModify(OrderTicket()...)
           Alert("OrderModify failed: ", GetLastError());
         */
    

 

this is code showing a range of the 10pip

#property  copyright "Copyright ?2004, MetaQuotes Software Corp."
#property  link      "http://www.metaquotes.net/"
//---- indicator settings
#property  indicator_chart_window
#property  indicator_buffers 1
#property  indicator_color1  Silver
#property  indicator_color2  Red
#property  indicator_width1  2
//---- indicator parameters

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
double sellmaximummargincallpoint, buymaximummargincallpoint, acurrencymargin0.01, bcurrencymargin0.01, sellmaximumlossmpossibleamount, buymaximumlossmpossibleamount;
double sell100marginpoint, buy100marginpoint, lotsmargin100, sell100lossmpossibleamount, buy100lossmpossibleamount, sellmaxpoint, buymaxpoint;

double sellmaxpoint1, sellmaxpoint2, buymaxpoint1, buymaxpoint2;

extern double pointtop1 = 0.001;
extern double pointdown1 = 0.001;
extern double pointtop2 = 0.002;
extern double pointdown2 = 0.002;


void init() {

  DeleteObjects();
Comment("");
}

void deinit() {
  DeleteObjects();
Comment("");
  
return(0);
}

void DeleteObjects() {
    ObjectsDeleteAll(0,OBJ_HLINE);
    ObjectsDeleteAll(0,OBJ_TEXT);  
    ObjectsDeleteAll(0,OBJ_LABEL); 
 return(0); 
}


//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {




//==================================================================== 매수주문 스탑로스 최저 포인트 (0.01랏만 샀을때 최저 가능한 포인트)


sellmaxpoint1 = Ask - (pointdown1);

sellmaxpoint2 = Ask - (pointdown2);

//-------------------------------------------------------------------




//==================================================================== 매도주문 스탑로스 최고 포인트



buymaxpoint1 = Bid + (pointtop1);

buymaxpoint2 = Bid + (pointtop2);

//--------------------------------------------------------------------



double middle = (Ask + Bid) / 2 ;





ObjectCreate("a",OBJ_RECTANGLE,0,0,0,0,0);
ObjectSet("a",OBJPROP_TIME1,Time[0]-10000);
ObjectSet("a",OBJPROP_TIME2,Time[0]+10000);
ObjectSet("a",OBJPROP_BACK,true);//Line added
ObjectSet("a",OBJPROP_COLOR, MistyRose);
ObjectSet("a",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("a",OBJPROP_PRICE1,buymaxpoint1);
ObjectSet("a",OBJPROP_PRICE2,buymaxpoint2);
ObjectSet("a",OBJPROP_WIDTH,11);
ObjectSet("a",OBJPROP_YDISTANCE, 0);
ObjectSet("a",OBJPROP_RAY, false);

ObjectCreate("b",OBJ_RECTANGLE,0,0,0,0,0);
ObjectSet("b",OBJPROP_TIME1,Time[0]-10000);
ObjectSet("b",OBJPROP_TIME2,Time[0]+10000);
ObjectSet("b",OBJPROP_BACK,true);//Line added
ObjectSet("b",OBJPROP_COLOR,Pink);
ObjectSet("b",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("b",OBJPROP_PRICE1,middle);
ObjectSet("b",OBJPROP_PRICE2,buymaxpoint1);
ObjectSet("b",OBJPROP_YDISTANCE, 0);
ObjectSet("b",OBJPROP_RAY, false);

ObjectCreate("c",OBJ_RECTANGLE,0,0,0,0,0);
ObjectSet("c",OBJPROP_TIME1,Time[0]-10000);
ObjectSet("c",OBJPROP_TIME2,Time[0]+10000);
ObjectSet("c",OBJPROP_BACK,true);//Line added
ObjectSet("c",OBJPROP_COLOR,PaleTurquoise);
ObjectSet("c",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("c",OBJPROP_PRICE1,middle);
ObjectSet("c",OBJPROP_PRICE2,sellmaxpoint1);
ObjectSet("c",OBJPROP_YDISTANCE, 0);
ObjectSet("c",OBJPROP_RAY, false);

ObjectCreate("d",OBJ_RECTANGLE,0,0,0,0,0);
ObjectSet("d",OBJPROP_TIME1,Time[0]-10000);
ObjectSet("d",OBJPROP_TIME2,Time[0]+10000);
ObjectSet("d",OBJPROP_BACK,true);//Line added
ObjectSet("d",OBJPROP_COLOR,LightCyan);
ObjectSet("d",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("d",OBJPROP_PRICE1,sellmaxpoint1);
ObjectSet("d",OBJPROP_PRICE2,sellmaxpoint2);
ObjectSet("d",OBJPROP_WIDTH,11);
ObjectSet("d",OBJPROP_YDISTANCE, 0);
ObjectSet("d",OBJPROP_RAY, false);







bcurrencymargin0.01 = ((Bid / 100)+Bid); // 0.01마진증거금 금액 계산
buymaximumlossmpossibleamount = AccountEquity() - (bcurrencymargin0.01*0.2); // 평균가액에 0.01랏의 마진콜 금액만 뺌
buymaximummargincallpoint   = Bid + (buymaximumlossmpossibleamount*0.001);


//-------------------------------------------------------------------- 최대 랏 구매 가능 금액

buy100marginpoint = Bid + (acurrencymargin0.01*0.8*0.001); // 최대로 샀을때 마진콜 당하는 선

//-------------------------------------------------------------------- 최대 가능 랏수

double lot1 = (AccountFreeMargin() / bcurrencymargin0.01)*0.01;
double lot = NormalizeDouble(lot1-0.01,2); // 반올림




Comment(
"maximumlot = "+DoubleToStr(lot,2),"\n",
"SPREAD = "+MarketInfo( Symbol(),MODE_SPREAD),"\n" 
);


double abc;
ObjectCreate(abc, OBJ_LABEL, 0, 0, 0);
ObjectSet(abc, OBJPROP_COLOR, Tomato);
ObjectSet(abc, OBJPROP_XDISTANCE, 300);
ObjectSet(abc, OBJPROP_YDISTANCE, 300);
   ObjectSetText(abc, DoubleToStr(lot,2), 9, "Lucida Console Bold",Red);







return(0);

}

I want that different symbol in other chart will be applied automatically Equally.

extern double pointtop1 = 0.001;
extern double pointdown1 = 0.001;
extern double pointtop2 = 0.002;
extern double pointdown2 = 0.002;

I want All Charts to be applied automatically 10 pips.

What do I need to modify this code?

 
  1. extern double pointtop1 = 0.001;
    This is 10 pips on all currency pairs except JPY. The code fails on xxxJPY and on metals.
  2. I want All Charts to be applied automatically 10 pips. What do I need to modify this code?
    NOTHING. Just drag the indicator from the navigator window to the new chart.
Reason: