Forum

Get datetime from index of a bar that has not yet occured

I am writing an EA that places limit orders with expiration. Expiration is set to the datetime corresponding to a given number of bars after the current bar. I can get datetime from a past bar index using datetime CiTime::GetData(int index). However, I do not know how to get datetime from the index

expert advisor cannot open files but script can

Hi, I have a binary file containing an array and my expert advisor needs to read it. However, I can't get it to open the file. I can open it with a script though. I think that the expert advisor is not looking for my file in the same folder as the script. I have put it in

prev_calculated logic in Expert Advisors?

I am trying to convert an indicator that is too complex to be called by iCustom into an expert advisor. When I say too complicated, I mean that we would need to copy hundreds of indicator buffers. So Instead I am porting the indicator code directly to the EA code. Most of it is straightforward, but

variable profit and stop loss in CExpertSignal

Hello, I would like to create a descendant class of CExpertSignal. I plan to use make it callable by the EA wizard, as demonstrated here: https://www.mql5.com/en/articles/367 . An instance of this class will be added as a filter in the CExpertSignal generated. In addition to giving a buy or sell