i use Camarilla pivots also and I think you mean something different than is answered here.
first off all your question is not clear because you first talk about current month ML3 and last month MH4, but then in the buy line you use the current month ML3 and last month MH3. So I assume you mean current month ML3 and last month MH3. Then below the code how you calculate this.
This months levels MH3 level is called MH30 and last months MH3 level is called MH31
// current month's levels
PMH = TimeFrameGetPrice("H", inMonthly, -1);
PML = TimeFrameGetPrice("L", inMonthly, -1);
PMC = TimeFrameGetPrice("C", inMonthly, -1);
MH50 = (PMH/PML) * PMC ;
MH40 = PMC + (PMH - PML) * 1.1 / 2.0;
MH30 = PMC + (PMH - PML) * 1.1 / 4.0;
ML30 = PMC - (PMH - PML) * 1.1 / 4.0;
ML40 = PMC - (PMH - PML) * 1.1 / 2.0;
ML50 = PMC - (MH50 - PMC);
// the levels 1 month before current month
PMH = TimeFrameGetPrice("H", inMonthly, -2);
PML = TimeFrameGetPrice("L", inMonthly, -2);
PMC = TimeFrameGetPrice("C", inMonthly, -2);
MH51 = (PMH/PML) * PMC ;
MH41 = PMC + (PMH - PML) * 1.1 / 2.0;
MH31 = PMC + (PMH - PML) * 1.1 / 4.0;
ML31 = PMC - (PMH - PML) * 1.1 / 4.0;
ML41 = PMC - (PMH - PML) * 1.1 / 2.0;
ML51 = PMC - (MH51 - PMC);
GraphXSpace = 5;
SetChartOptions( 0, chartShowDates );
Plot( C, "\nPrice", IIf( C > O, ColorRGB( 0, 255, 0 ), IIf( C <= O, ColorRGB( 255, 0, 0 ), colorLightGrey ) ), 64, Null, Null, 0, 0 );
Plot( MH30, "MH30", ColorRGB( 0, 255, 0 ), styleThick, Null, Null, 0, -1 );
Plot( ML30, "ML30", ColorRGB( 255 - 0, 255 - 255, 255 - 0 ), styleThick, Null, Null, 0, -1 );
Plot( MH40, "MH40", ColorRGB( 0, 100, 0 ), styleThick, Null, Null, 0, -1 );
Plot( ML40, "ML40", ColorRGB( 255 - 0, 255 - 100, 255 - 0 ), styleThick, Null, Null, 0, -1 );
Plot( MH31, "MH31", ColorWhite, styleThick | styleDots, Null, Null, 0, -1 );
Buy = Cross( C, MH30 ) AND ML30 > MH31;
BuyPrice = C;
PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorDarkGreen, 0, L, -15 );
PlotShapes( IIf( Buy, shapeSmallCircle, shapeNone ), colorWhite, 0, BuyPrice, 0 );