/*********************************Provided By : eSignal. (c) Copyright 2003*********************************/function preMain() { setPriceStudy(true); setShowCursorLabel(false);}var colorBG = null;var colorOpen = null;var colorClose = null;var vOpen;var vHigh;var vLow;var vClose;var DrawCntr = 0;var vLoading = true;function main(nBarThickness, nNumBars) { if (nBarThickness == null) { nBarThickness = 3; } if (nNumBars == null || Math.abs(nNumBars) > 60) { nNumBars = 60; } var nBarState = getBarState(); if (getCurrentBarIndex() == 0) { vLoading = false; } var vPrice = close(); if (nBarState == BARSTATE_NEWBAR) { if (vLoading == false) { colorBG = null; colorOpen = null; colorClose = null; vOpen = vPrice; vHigh = vPrice; vLow = vPrice; vClose = vPrice; } DrawCntr += 1; if (DrawCntr > nNumBars) { DrawCntr = 0; } } if (vLoading == false) { vHigh = Math.max(vPrice, vHigh); vLow = Math.min(vPrice, vLow); vClose = vPrice; //open if (nBarState == BARSTATE_NEWBAR) { drawLineRelative(-1, vOpen, 0, vOpen, PS_SOLID, 1, Color.blue, "Open" + DrawCntr); } //high - low if (vClose >= vOpen) { colorHL = Color.green; } else { colorHL = Color.red; } drawLineRelative(0, vHigh, 0, vLow, PS_SOLID, nBarThickness, colorHL, "HL" + DrawCntr); //close drawLineRelative(0, vClose, 1, vClose, PS_SOLID, 1, Color.lime, "Close" + DrawCntr); } return;} |