More Information about:
Link: 1) www.forexrealm.com/technical-analysis/technical-indicators/price-action-indicator.html





Source Code "Price Action Indicator":

function init()
{
   with (PAIN) {
     createBuffer("PAIN");
     setBufferColor("PAIN", "lime");
     setBufferDrawStyle("PAIN", DrawStyle.LINE);
     setAutoChangeMaxMin("PAIN");
   }
}

function start()
{
   PAIN.label = "PAIN";
   PAIN.addLevel(0, "white");

   var num = Shared.numberOfQuotes();
   var PAINBuf = new Array(num);

   var OpenBuf = Shared.open();
   var CloseBuf = Shared.close();
   var HighBuf = Shared.high();
   var LowBuf = Shared.low();

   for (var i = 0; i < num; ++i) {
     PAINBuf[i] = ((CloseBuf[i]-OpenBuf[i]) + (CloseBuf[i]-HighBuf[i]) + (CloseBuf[i]-LowBuf[i])) / 2 ;
   }

   PAIN.setBufferData("PAIN", PAINBuf);
}