Hi everybody,
creating a study that is similar to pivot points I was able to tweek a "monthly pivot points" that I found in here. Now I would like to create that same study for a "quaterly" and later on "yearly" level. Does anybody know, how to change the time reference for it to create these time levels?
This is from "monthly Pivot":
if(vInterval == null)
return null;
if(vInterval == "M")
return null;
if(vInterval == "T")
return null;
var vMonth0 = getMonth();
var vMonth1 = getMonth(-1);
if (vMonth0 != vMonth1) {
vBarTime = getValue("time");
var vTime = new Date();
if(vBarTime != null) {
if (vTime.getYear() == vBarTime.getYear()) {
vIndex = ((vTime.getMonth()+1 - vBarTime.getMonth()+1) * -1)+1;
} else {
vIndex = (((vTime.getMonth()+1 + ((vTime.getYear() - vBarTime.getYear()) * 12)) - vBarTime.getMonth()+1) * -1)+1;
}
if(vIndex != null) {
vH = getValueAbsolute("High", vIndex, vSymbol);
vL = getValueAbsolute("Low", vIndex, vSymbol);
vC = getValueAbsolute("Close", vIndex, vSymbol);
if(vH != null && vL != null && vC != null) {
vLastPP = (vH + vL + vC) / 3;
I`ll be thankful for any suggestion
cheers
creating a study that is similar to pivot points I was able to tweek a "monthly pivot points" that I found in here. Now I would like to create that same study for a "quaterly" and later on "yearly" level. Does anybody know, how to change the time reference for it to create these time levels?
This is from "monthly Pivot":
if(vInterval == null)
return null;
if(vInterval == "M")
return null;
if(vInterval == "T")
return null;
var vMonth0 = getMonth();
var vMonth1 = getMonth(-1);
if (vMonth0 != vMonth1) {
vBarTime = getValue("time");
var vTime = new Date();
if(vBarTime != null) {
if (vTime.getYear() == vBarTime.getYear()) {
vIndex = ((vTime.getMonth()+1 - vBarTime.getMonth()+1) * -1)+1;
} else {
vIndex = (((vTime.getMonth()+1 + ((vTime.getYear() - vBarTime.getYear()) * 12)) - vBarTime.getMonth()+1) * -1)+1;
}
if(vIndex != null) {
vH = getValueAbsolute("High", vIndex, vSymbol);
vL = getValueAbsolute("Low", vIndex, vSymbol);
vC = getValueAbsolute("Close", vIndex, vSymbol);
if(vH != null && vL != null && vC != null) {
vLastPP = (vH + vL + vC) / 3;
I`ll be thankful for any suggestion
cheers
Comment