Forum

Dynmically position BUTTON object

Dear experts, How can I position my BUTTON object dynamically on chart in a way that when chart size changes or MT5 window is resized I can still see the buttons at the left most side of my chart (st like like Aligned left compared to chart window). I create my BUTTON object with below code now and

Generic formula to calculate position profit from price, pips, lots

Dear experts, I read 3,4 form threads about position profit calculation but still can not figure out the correct formula to find profit from the price difference and SYMBOL values. My account currency is USD and here are the values from my broker for an EURUSD position: For EURUSD

Cannot Delete Objects in Deinit()

Dear experts, I have BUTTON and LABEL Objects on my chart and I want to delete all these chart objects during the removal of EA from Chart. I tried both of these in Deinit() and they did not work: void Deinit( const int reason) { StopTimer(); if (reason == 1 ) { ObjectsDeleteAll ( 0 );};

Question on OnTick() event frequency/duration

Dear experts, I have question on OnTick() event . Let's say OnTick() is triggered at every 1ms but the actions you perform inside OnTick() itself takes 5ms which is more than 1ms. What happens in such cases ? Do actions accumulate or happen in parallel or next action skipped as previous one is still

Change the color of Technical Indicator

hi experts, I want to use 3 iMA indicators in my code and I want to set different color to them. How can I achieve this ?. This is how I start in OnInit() : thank you .. .. int OnInit () { //--- create timer EMA10Definition= iMA ( _Symbol , _Period , 9 , 0 , MODE_EMA , PRICE_CLOSE ) ;