Fulfillment Rounding of multiples of MA numbers in accordance with the rules of the stock exchange. Thanks very much
Please review this post: How to ask a good question
You mean to round off a number to the nearest multiple of Tick Size, right??? If so, then that's already answered here - Rounding to uniform integers. To add, Tomasz has already solved it for you in that thread - read this.
_SECTION_BEGIN( "Rounding-Off to nearest multiple of Tick Size" ); TickSz = 5; //You can also use the TickSize that you receive from your Data vendor such that you won't have to change this constant for every symbol individually Ma20 = MA( C, 20 ); RndMa20 = TickSz * round( Ma20 / TickSz ); Plot( C, "", colorDefault, styleBar | styleThick ); Plot( Ma20, "Ma20", colorAqua, styleLine ); Plot( RndMa20, "Ma20", colorLightOrange, styleNoLine | styleNoLabel | styleNoRescale ); Filter = 1; AddColumn( Ma20, "Ma20", 1.2 ); AddColumn( RndMa20, "RndMa20", 1.2 ); _SECTION_END();
Thanks very much and Your kindness...
My freind alredy help. Thanks
MA5= TICK * round(MA(C,5)/TICK);
MA20= TICK * round(MA(C,20)/TICK);
Next time when you post a code in this forum please use the
Ok., thanks verry much