Getting the index of the lowest close price for the last 30 Candles.

MQL5 Experts Consultation

Job finished

Execution time 28 minutes
Feedback from employee
Excellent customer and developer. Thanks.
Feedback from customer
Developer was very patient and knowledgeable will definately work with The Huy Phan again

Specification

I have written an EA buy I am struggling to use ILowest within a loop.

If I print out ILowest I get the correct value. But If I iterate through a loop and increase the start position of ILowest I get different values.

Surely the logic is the same for printing it out on each new candle as it is changing the start index.

I require help to work out this logic.

Basically I want to save the previous lowest candle for the last 25 candles into an arraybased on close price.

If candle[1] is the lowest array[0] = 0

if candle[2] is also lowest array[1]=0

if candle[3] is second lowest array[2]=1 

   if(!isNewBar() && InpTradeOnNewBar)
     {
      return;
     }
       
  //Something like this can be done
  ArrayResize(buyarr,30)

  buyarr[0] = ilowest(Symbol(),Period(),Mode_close,InpLookBackPeriod,1) - 1;

  //Shift values up one

   if(CopyRates(Symbol(),Period(),0,InpLookBackPeriod,BuyRates) < InpLookBackPeriod ||
      CopyRates(Symbol(),Period(),0,InpSLookBackPeriod,SellRates) < InpSLookBackPeriod)
     {
      return;
     }

   buyrank=iLowest(Symbol(),Period(),MODE_CLOSE,InpLookBackPeriod,1) - 1;
   sellrank=iHighest(Symbol(),Period(),MODE_CLOSE,InpSLookBackPeriod,1) - 1;


   
   Print(buyrank); //this prints the correct value. I would like to save this value for the previous 25 candles

   ArrayResize(buyarr,InpLookBackPeriod);

   for(int i=0; i<InpLookBackPeriod; i++)
     {
      buyarr[i] = iLowest(Symbol(),Period(),MODE_CLOSE,InpLookBackPeriod,i+1) - 1;
     }
ArrayPrint(buyarr); // This prints out totally incorrect values.

Responded

1
Developer 1
Rating
(71)
Projects
103
20%
Arbitration
6
0% / 83%
Overdue
3
3%
Free
2
Developer 2
Rating
(169)
Projects
204
30%
Arbitration
25
40% / 44%
Overdue
12
6%
Free
3
Developer 3
Rating
(74)
Projects
121
43%
Arbitration
12
33% / 50%
Overdue
17
14%
Free
4
Developer 4
Rating
(356)
Projects
632
26%
Arbitration
89
73% / 13%
Overdue
12
2%
Free
Similar orders
The wizard 100 - 100000 USD
A robot that can predict trade and the same time have best trading strategies,And gives accurate signals that may yeld huge profit in a short periods of time.also able to play the market and make trade on it's self even if am not in the market and able to avoid trades with huge loses but not profitable
Hello, I would like to automate a strategy that is based on Fibonacci Retracement with different input, a daily read of 3 mins highest Close of the previous day, and lowest close of the day on 3 min timeframe, Then a specific line that will be named R, a video will be given to explain it, and main Trade (percentage per trade), With 1 cancelation added within the range of the R
------MAIN FUNCTIONS----------- Trade will enter buy trade after current candle goes below previous candle then within the same candle closes at or near the highest point. (PIN BAR) Trade will enter SELL trade after current candle goes below previous candle then within the same candle closes at or near the lowest point. (PIN BAR) ENTRY CANDLE TIMEFRAME: 1MIN, 5 MIN, 15MIN, 30MIN, H1, H4, DAILY PERCENTAGE DISTANCE
Hi Looking for an exisiting bot to create a Expert Advisor, that can pass prop firm Challenges (1 or 2 phases), like FTMO, MFF, TFF etc. Prop Firm EA Bot Using Gold Pairs Need source code Unlimited License NO martingale strategy Need to have nice entries and exits. NO big lots and low risk. Need complied with this restrictions: -Profit 10% -Max Drawdown (DD) 10% -Max Daily Loss 4% -All trades with SL -NO trades
H ello, I have a pinescript from trading view with several self-created indicators. Now I would like to convert these into an mt4/mt5 EA that trades automatically according to my specifications. The bot should also have an integrated news filter and not trade 2 hours before the news . I am looking for someone who can start immediately and deliver high-quality results. If you believe you are the right fit for this
I need a developer to code my strategy which is based on 2 x TFs of a single indicator and 1 TF of a confirmation Indicator. Contact me for more. MQ4 file is required after the job is done. Only developer with good reputation, please
Hello, I have a Pine Script from TradingView that includes several self-created indicators. I am looking for a professional and experienced developer to convert this script into an MT4/MT5 Expert Advisor (EA) that trades automatically according to my specifications. Key Requirements: Conversion of Pine Script to MT4/MT5 EA: Integrate multiple self-created indicators from the Pine Script. Implement specific trading
Hi i am searching for who can makes me Mt4 Robot Analysis Method = Candle + Ichimoku and also i want to attach image with Ea and image will provide from like when i attach my Ea to any type chart the chart image chnages to image which i attached to my Ea Message me for Ea parameters and for more information and only developer message me who is agree with 6days deadline and i will start job with developer on monday
Currently I have an mt4 file, I need to convert this mt4 robot to mt5 version for it, according to the available mt4 file, I can do some other ea if it meets the requirements
Unicorn model entry for boom and crash only to catch spikes and crashes... Selling crash and buying boom Please have knowledge about boom and crash before applying Also demo to confirm quick selection

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
to 1 day(s)