OSMA

 

Hi ,does anyone knows how to get the value displayed on the OSMA sub window to use it in a ea.

 
Nick Cloete: Hi ,does anyone knows how to get the value displayed on the OSMA sub window to use it in a ea.

Use the iOsMA() function!

Documentation on MQL5: Technical Indicators / iOsMA
Documentation on MQL5: Technical Indicators / iOsMA
  • www.mql5.com
iOsMA - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Fernando thks I have tried to get the value by using iOSMA but the value displayed is not the same as the actually value displayed on the sub window of the OSMA indicator. That is actually my problem.

 
Nick Cloete: Fernando thks I have tried to get the value by using iOSMA but the value displayed is not the same as the actually value displayed on the sub window of the OSMA indicator. That is actually my problem.

Then you are not using the function properly, or using different parameters to that of the chart. Show your code sample using the function, log output for it, and screenshot of the chart and data window you are using for reference, and explain the differences you are getting.

Please remember that the function will return a more precise value (more digits) than the value shown on the chart or data window (also depends on the precision you are using in Prints).