Hi ,
I tried to go through the interval new function in EFS but with no luck .
I'm trying to get a signal ( Up or Down ) when StochStudy.FAST < StochStudy.SLOW for the 15 min chart and the 30 min chart but I'm facing errors all the time .
Can you help me out in my code .
Regards,
var vStoch8_3 = new StochStudy(8, 3, 3);
var vLastAlert = -1;
function preMain() {
setPriceStudy(true);
setStudyTitle("JIR - ALL NEW");
}
function main() {
if (
vStoch8_3.getValue(StochStudy.FAST) < vStoch8_3.getValue(StochStudy.SLOW) &&
vStoch8_3.getValue(StochStudy.FAST) > 75 &&
vStoch8_3.getValue(StochStudy.FAST, inv(15)) < vStoch8_3.getValue(StochStudy.SLOW, inv(15))
) onAction1()
else if (
vStoch8_3.getValue(StochStudy.FAST) > vStoch8_3.getValue(StochStudy.SLOW) &&
vStoch8_3.getValue(StochStudy.FAST) < 20 &&
vStoch8_3.getValue(StochStudy.FAST) > vStoch8_3.getValue(StochStudy.SLOW, inv(15))
) onAction2();
return null;
}
function postMain() {
}
function onAction1() {
drawTextRelative(0, high(), "Down", Color.RGB(155,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
vLastAlert = 1;
}
function onAction2() {
drawTextRelative(0, low(), "Up", Color.RGB(0,128,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
vLastAlert = 2;
}
I tried to go through the interval new function in EFS but with no luck .
I'm trying to get a signal ( Up or Down ) when StochStudy.FAST < StochStudy.SLOW for the 15 min chart and the 30 min chart but I'm facing errors all the time .
Can you help me out in my code .
Regards,
var vStoch8_3 = new StochStudy(8, 3, 3);
var vLastAlert = -1;
function preMain() {
setPriceStudy(true);
setStudyTitle("JIR - ALL NEW");
}
function main() {
if (
vStoch8_3.getValue(StochStudy.FAST) < vStoch8_3.getValue(StochStudy.SLOW) &&
vStoch8_3.getValue(StochStudy.FAST) > 75 &&
vStoch8_3.getValue(StochStudy.FAST, inv(15)) < vStoch8_3.getValue(StochStudy.SLOW, inv(15))
) onAction1()
else if (
vStoch8_3.getValue(StochStudy.FAST) > vStoch8_3.getValue(StochStudy.SLOW) &&
vStoch8_3.getValue(StochStudy.FAST) < 20 &&
vStoch8_3.getValue(StochStudy.FAST) > vStoch8_3.getValue(StochStudy.SLOW, inv(15))
) onAction2();
return null;
}
function postMain() {
}
function onAction1() {
drawTextRelative(0, high(), "Down", Color.RGB(155,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
vLastAlert = 1;
}
function onAction2() {
drawTextRelative(0, low(), "Up", Color.RGB(0,128,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
vLastAlert = 2;
}
Comment