Script: LogResult | Mastock Help



Short Name: LogResult

Definition: Utility used to debug a script, log intermediate results in the console

Usage: logResult(object)

Objective:
  • Write the representation of the object in the console
  • Does not return anything

Note:
  • You can access the console, on your Mac, through Applications, Utilities, Console

Examples:
  • logResult(1) will write 1 in the console
  • logResult(finished) will write finished
  • logResult(scalar variable) will write the current value of the variable
  • logResult(array variable) will write all the current values in the array
  • OBV:
  • varRSI = RSI(14)
  • index = 0
  • while(index < 2)
  • if(index == 0) then
  • for(0,10)
  • valeur = var(varRSI,0)
  • accumulate(premier,valeur)
  • endfor
  • logresult(stddev(premier))
  • notifyresult
  • else
  • avg20 = avg(20)
  • avg50 = avg(50)
  • buy = crossabove(avg20,avg50)
  • sell = crossbelow(avg20,avg50)
  • notifyresult(buy,sell)
  • endif
  • increment(index,1)
  • endwhile
  • logresult(it works...)