Download MetaTrader 5

Can't get CiSAR to return a valid value

To add comments, please log in or register
noonehastherighttojudgeanother
235
noonehastherighttojudgeanother  
#property link      "http://www.mql5.com"
#property version   "1.00"
#include <Indicators\Indicators.mqh>

input double _SARS1 = 0.12;
input double _SARM1 = 0.2;

CiSAR sar1,sar2,sar3,sar4;
//+------------------------------------------------------------------+
int OnInit()
  {
   sar1.Create(Symbol(),Period(),_SARS1,_SARM1);
   return(0);
  }
//+------------------------------------------------------------------+
void OnTimer()
  {
  }
//+------------------------------------------------------------------+
void OnTrade()
  {
  }
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
void OnTick()
  {
   CheckSignalsForTrade();
   return;
  }
//+------------------------------------------------------------------+
bool CheckSignalsForTrade()
  {
     {
      Print(sar1.Main(0));
     }
   return(true);
  }

I'm gonna say "oh... right" as soon as some one tells me... but the print statement in this sample code always produces 1.79 x e308.  A huge number - likely the unintialized value of the buffer... There must be some step here that i'm missing.  Thanks in advance.

sn 

To add comments, please log in or register