Download MetaTrader 5

Using iSar

To add comments, please log in or register
jamesmean
189
jamesmean  

Hello,

 

I am trying to use a confirmation for iSar with the following code:

 

(iSAR(_Symbol,PERIOD_D1,.02,.2) < PRICE_CLOSE) 

 

However, although everything compiles directly, the program still trades even if the daily SAR price  is above or below the close price.  Did I misunderstand this line of coding?

 

 Thanks!

 

James 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
Andrey Barinov
39276
Andrey Barinov  
jamesmean:

Hello,

 

I am trying to use a confirmation for iSar with the following code:

 

(iSAR(_Symbol,PERIOD_D1,.02,.2) < PRICE_CLOSE) 

 

However, although everything compiles directly, the program still trades even if the daily SAR price  is above or below the close price.  Did I misunderstand this line of coding?

 

 Thanks!

 

James 

Hi, please, refer to CopyBuffer() function for some info about how to use indicators in MT5.
Alain Verleyen
Moderator
31203
Alain Verleyen  
jamesmean:

Hello,

 

I am trying to use a confirmation for iSar with the following code:

 

(iSAR(_Symbol,PERIOD_D1,.02,.2) < PRICE_CLOSE) 

...

This forum is about MT5/mql5, if your question is about MT4/mql4 please use the mql4.com forum.

Otherwise you can read the documentation about iSAR and some articles, this one for example https://www.mql5.com/en/articles/35

Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator
  • 2010.04.07
  • Denis Zyatkevich
  • www.mql5.com
MetaQuotes Programming Language 5 (MQL5), included in MetaTrader 5 Client Terminal, has many new possibilities and higher performance, compared to MQL4. This article will help you to get acquainted with this new programming language. The simple examples of how to write an Expert Advisor and Custom Indicator are presented in this article. We...
To add comments, please log in or register