Forum

2 pending orders when 1 is triggered, delete the other if take profit

I have 2 pending orders 1 BUY, 1 SELL. If 1 of these trades is triggered and hits its take profit , I want to cancel the other order. If it instead, hits its stop loss, I want to keep the other order. ////////////////////////////////////////////////////////// //IT IS NOW after 0700GMT but before

ichimoku alerts

Is this the right way t do ichimoku alerts in MQL4? The alerts are at the bottom. I haven't figure dout a way of swapping over the senkou span/kumo cloud alerts yet apart from the alert every time the Bid price crosses. Complete code in the attached notepad file. //----ALERTS //---- TS cross KS if (

Heiken Ashi code bug

No matter what I do, when I change the width from 2 to 3 in the setindexstyle, when I open the indicator on a chart, it sets all inputs to zero. Yet when the index are set as 1 and 2 respectively, everything loads. This frustrating because everytime I change timeframe, it resets all the heiken ashi

change background color

Is there a way to change the chart background color depending on a variable in MQL4

alarm going off repeatedly

I have coded this so that once the alarm fires, it sets the Bars count and shouldnèt trigger again for 5mins. However, when the lines cross, the a;larm keeps triggering every few ticks as the values cross and uncross. How can I stop this" if (iMAOnArray(TSI_Buffer, 0 , 7 , 0 , MODE_EMA , 0 ) <

EMA of a buffer

I'm trying to get the exp moving average of the TSI buffer in this code and then draw the EMA on the indicator. However, it does not draw the value correctly as the red and yellow lines are very far apart, they should be crossing over each other. Any ideas where I have gone wrong

pattern recognition indicators?

Are there any decent pattern recognition indicators for MQL4

rectangle from midnight

I would like to start this rectangle from midnight, how can I specify the time? ObjectCreate("box", OBJ_RECTANGLE ,0,Time[24],hprice,Time[0],lprice);

new order each hour

I have some code to create some orders once per hour. Do I need to run it in a for lopp for each section ie 0 to 24 to do this? //create new orders, open at xx:00 if (Hour() == 0 && Minute() == 0 && varH1BiasDirection == 1 && OrderSetFlag == 0 ) { OrderSend (

start of day rectangle

I am trying to display a rectangle from the start of the day 0000 to the current candle. How can I get start of the day into the Time[] section? ObjectCreate("Rectangle", OBJ_RECTANGLE ,0,Time[24],RectangleLow,Time[0],RectangleHigh); ObjectSet("Rectangle",OBJPROP_SCALE,1.0);