Appreciate help on this

 

Hi 

I use an EA with last price of an executed order OPLAST. Then this price should be used in an custom Indicator to compute a difference between OPLAST and close price and return back to EA.

In the computation, the OPLAST is not recognised in the Indicator and return only the close. I do not know if it has to do with variable declaration or something else?.


I attach both code EA and Indicator (Difference)


Thanks a lot

Files:
EA.mq5  6 kb
 
amine.mounir:

In the computation, the OPLAST is not recognised in the Indicator and return only the close.

yes you will receive a close
it is expected for ea to receive data from indicator
not the way you think of if

suggestion
export the order to csv and import to ea and indicator

 
Samuel Akinbowale:

yes you will receive a close
it is expected for ea to receive data from indicator
not the way you think of if

suggestion
export the order to csv and import to ea and indicator

Dear Samuel, thanks a lot for the suggestion and would like to implement it. If i do unterstand Export OPLAST to CSV and then import it to the Indicator. I insert to the EA the instruction: FileWrite(filePtr ,TimeToString(TimeCurrent(), TIME_DATE | TIME_MINUTES ),rates[0].close , OPLAST);
How could I import to the indicators.
Since he OPLAST will change all the time is this can be changed also in the Indicator?
Thank you so much
 
amine.mounir:
How could I import to the indicators.


https://www.mql5.com/en/forum/6816

Help needed , how to import a cvs file data as an indicator
Help needed , how to import a cvs file data as an indicator
  • 2012.05.31
  • www.mql5.com
Hi, I got a csv file with a list of data: Datetime, and values...
 
Documentation on MQL5: File Functions / FileOpen
Documentation on MQL5: File Functions / FileOpen
  • www.mql5.com
[in]  The name of the file can contain subfolders. If the file is opened for writing, these subfolders will be created if there are no such ones. [in]  value to be used as a separator in txt or csv-file. If the csv-file delimiter is not specified, it defaults to a tab. If the txt-file delimiter is not specified, then no separator is used. If...