Help with porting ThinkScript's recursion variables

 

Hi, I'm trying to port a ThinkScript to MT5 but struggling on this part of the code:

[ThinkScript]

def upper = if close[1] < upper[1] then Min(up, upper[1]) else up;

How would you declare upper in MT5?

Thanks,

Tom

 
10basetom:

Hi, I'm trying to port a ThinkScript to MT5 but struggling on this part of the code:

[ThinkScript]

How would you declare upper in MT5?

Thanks,

Tom

Maybe the MQL5 documentation helps?

https://www.mql5.com/en/docs/basis/preprosessor/constant

Documentation on MQL5: Language Basics / Preprocessor / Macro substitution (#define)
Documentation on MQL5: Language Basics / Preprocessor / Macro substitution (#define)
  • www.mql5.com
Macro substitution (#define) - Preprocessor - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
R4tna C #:

Maybe the MQL5 documentation helps?

https://www.mql5.com/en/docs/basis/preprosessor/constant

Thanks, I'll read up on this.
 
10basetom: How would you declare upper in MT5?

def upper = if close[1] < upper[1] then Min(up, upper[1]) else up;

It is a buffer.