What does p1-=1 mean? (in OBJ_TREND MQL4 documention example)

 

I am trying to add trendlines to a chart based on OBJ_TREND in the MQL4 documentation example. https://docs.mql4.com/constants/objectconstants/enum_object/obj_trend

Can someone please explain what p1-=1 means in the for loop 

  

 for(int i=0;i<v_steps;i++)

     {
      //--- use the following value
            if(p1>1)

         p1-=1;
      //--- move the point
      if(!TrendPointChange(0,InpName,0,date[d1],price[p1]))
         return;
      //--- check if the script's operation has been forcefully disabled
      if(IsStopped())
         return;
      //--- redraw the chart
      ChartRedraw();
 
DrTrueman:

Can someone please explain what p1-=1 means in the for loop  

It's simply a shorter way of writing this:

p1 = p1 - 1

Another, and more usual, way of writing the same thing would be:

p1--

Documentation of this at the following addresses:

https://docs.mql4.com/basis/operations/assign 

https://docs.mql4.com/basis/operations/mathoperation 

 
Thank you very much jjc.