Hello,
I have a special formula for buying:
function preMain() {
setPriceStudy(true);
setStudyTitle("Buy 4 GSV");
setCursorLabelName("Buy 4 GSV");
setDefaultBarStyle(PS_SOLID);
setDefaultBarFgColor(Color.blue);
setDefaultBarThickness(2);
setPlotType(PLOTTYPE_FLATLINES);
}
function main() {
return open(0) + (((high(-4) - open(-4) + high(-3) - open(-3) + high(-2) - open(-2) + high(-1) - open(-1)) / 4 ) * 1.8);
}
This formula should be fulfiled only when close<open. For example, high(-4) - open(-4) if close < open.
How can I put the condition into my formula?
I am waiting for your help.
Thanks,
Tonal
I have a special formula for buying:
function preMain() {
setPriceStudy(true);
setStudyTitle("Buy 4 GSV");
setCursorLabelName("Buy 4 GSV");
setDefaultBarStyle(PS_SOLID);
setDefaultBarFgColor(Color.blue);
setDefaultBarThickness(2);
setPlotType(PLOTTYPE_FLATLINES);
}
function main() {
return open(0) + (((high(-4) - open(-4) + high(-3) - open(-3) + high(-2) - open(-2) + high(-1) - open(-1)) / 4 ) * 1.8);
}
This formula should be fulfiled only when close<open. For example, high(-4) - open(-4) if close < open.
How can I put the condition into my formula?
I am waiting for your help.
Thanks,
Tonal
Comment