Forum

Code to store price of last two moving average crosses

I have found the above thread while looking for some help. I would like to be able to compare the last two moving average cross prices (slow MA). How would I be able to change the methods shown in this thread to be able to do this? https://www.mql5.com/en/forum/216386 The methods seem to only get

Trade/Pending Order Trail error

As part of my trading system I have a buy stop and sell stop pending order concurrently. I have a stop loss trail code for when either trade is activated. In the event that the price fluctuates and activates both trades then the stop loss trailing code works. However if only one of the pending

Day High Low Indicator Data Extraction for EA

I have found a indicator on this website which provides previous day (or week / /month) high and low prices. I want to use this as the basis of creating my own EA to place buystops and sellstops at the previous day high and low. Link: https://www.mql5.com/en/code/14410 I can see the code I want to

Count profit of x number closed trades

I would like to count the profit of a varying number of closed trades. At the start of a martingale string of trades, each trade is provided with a tradenumber in the OrderComment (). The trade number is increased by 1 after each loss until a win where the number is reset. After a certain