Buffer for custom value?

 

Hey everyone,

I'm trying to figure out the best way to store a value in a buffer similar to CopyBuffer, but the value isn't from an indicator. Id like the EA to check if the value is higher or lower than the previous bar.

Something like this:

if(MyValue[0] < MyValue[1])
{
//Do something...;
}

What's the best way to go about this?

Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
  • www.mql5.com
order_calc_margin - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
tnil25: e EA to check if the value is higher or lower than the previous bar.

An array is not required for that. Save the current value in a static/global variable and compare on the next bar.
          New candle - MQL4 programming forum #3 2014.04.04

 
tnil25:

Hey everyone,

I'm trying to figure out the best way to store a value in a buffer similar to CopyBuffer, but the value isn't from an indicator. Id like the EA to check if the value is higher or lower than the previous bar.

Something like this:

What's the best way to go about this?

Define Myvalue[] as an array

then you can specify different amounts into each element

Reason: