Forum

ObjectSet and ObjectSetText not recognised by MetaEditor context sensitivity and don't operate as expected

Hello Trying out code from https://www.mql5.com/en/forum/130611/3340415#comment_3340415 as I have plotted a series of HLINEs and want to change the font of the descriptions of each: if ( ObjectSetText (_lineName, "What you want to call your line", 8 , "Arial", Magenta)) { afxHandleError(

Draw rectangle around range of bars by hours

Hello This ought to be easy but I'm finding it fiendish. I want to draw a rectangle around my non-trading hours. I can do this ok in a custom indicator , by scanning the Bars-IndicatorCounted() for the start hour of my trading day, and when I get that, draw a rectangle from the endOfTradingDay bar

Update script that Changes all templates using UserDLL to only affect certain charts

Hello I have this script which works great, and changes *all* my charts to a selected template. But I have various fx pairs and oil and gold, and I don't want the template change to affect the oil and gold as I have different templates for them, so I have to keep changing them after running the

ChartSymbol() not working as expected

Hello I have a function in my EA: void SetAllChartsToPeriod( int _period) { long currChart,prevChart= ChartFirst (); int lim = 30 ; int i= 0 ; while (i<lim && prevChart != - 1 ) { currChart= ChartNext (prevChart); // Get the new chart ID by using the

ChartSymbol Fails to see a valid chart

Hello Anyone else had this? I've attached an Alert from this code: void afxSetAllChartsToPeriod( int _period) { long chid= ChartFirst (); Alert ( "First chart is " ,chid, "sym " , ChartSymbol (chid)); chid= ChartNext (chid); Alert ( "Second chart is " ,chid

Pending Order line not drawn

Hi My investor's PC appears to be creating trades OK, SL/TP drawn, but not the actually order line itself. See the attached pic. I've worked with mt4 and mql4 for about 6 years now and not ever seen this and wouldn't know where to look. Google not returning anything useful either. Has anyone else

mqh function not defined

Hello I'm missing something which I cannot see easily on google. Maybe I'm missing the point of header use. I'm getting 'RefreshRates' - function not defined when I compile a .mqh file. The same applies for loads of other functions I'm trying to use in a header file. How can I fix this

Date Arithmetic

Hello I have a fn which calcs missed daily, weekly and monthly pivots, and plots lines. Due to the lines being triggered by buttons, the calc is done in an EA, not an indicator. I need to plot the lines to start level with the first bar of the day (daily), week (weekly, i.e. Monday 0000) and month

Best way to calculate bars in a week

Hello I'm working on a bespoke missed weekly pivots calculation. If the user pulls such onto an M5 chart, as I process the Bars, if the Time of the last bar (i+1) is Sunday and the time of 'this' bar is Monday, I know i+1 is the last of last week. What I was thinking of doing was then counting back

maximisation issue

Hi Sometimes, when I have a load of charts unmaximised, I maximise one of them for a while. When I switch to the others they are maximised in window, but the window contents is still the same dimensions of the window as it was previously and the rest of the window is just black. I have to unmaximise