Forum

Standard Deviation Channel - Least Squares Method

Hi everyone, I am trying to draw a standard deviation channel as part of my EA using the Least Squares Method: https://www.mathsisfun.com/data/least-squares-regression.html But I am getting some strange values. Can anyone spot something in the code that I am doing wrong? Or is it just because iTime

Limiting number of trades per candle

Good day, I am trying to limit the number of trades per candle to 1. I am using a method that has previously worked for me but I can't figure out why it doesn't work in the function below: void BuyAndSell() { static int CandleOpenTime; if ((CandleOpenTime== iTime ( "XX" , PERIOD_M5

Adding elements to an Array

Hi all, I am trying to add elements (values of an indicator), tick by tick, to an array. I managed to do it with the following code but I imagine there is a more practical way without all of the shifting. And obviously the code below results in some lagging. #include <Arrays\ArrayDouble.mqh>

Storing elements from one array to another based on specified conditions

Good day, I am trying to transfer elements from one array to another but only if the values meet specific criteria. (E.g. If the value is !=0). Can someone please point me in a direction of how to approach this. Below are some thought I had but I have no clue. Please keep in mind that I am NEW TO

Please help with my Trail Stop

Hi all, Can someone please help me with my trailing stop? I have three different levels: 1 - Stop loss following at Moving Average 2 - Locking in Pips 3- Trailing The function works but seems to break at some point and only work if I reload the EA. How can I ensure that the EA looks at all the IF