I'm trying to write a template that allows me to menu pretty much everything...
I'm stuck trying to build the following drawshape and strategy statements. I would think the resolution is the same for both.
Do I need to build the two lines as strings, then turn them into objects? Or do something else?
Thanks,
-function THEO( Foggy );
I'm stuck trying to build the following drawshape and strategy statements. I would think the resolution is the same for both.
Do I need to build the two lines as strings, then turn them into objects? Or do something else?
Thanks,
-function THEO( Foggy );
PHP Code:
// TEST
function preMain() {
setStudyTitle("Test");
setPriceStudy(true);
var fp1 = new FunctionParameter("vSource", FunctionParameter.STRING);
fp1.setName("Source");
fp1.addOption("Close");
fp1.addOption("High");
fp1.addOption("Low");
fp1.addOption("Open");
fp1.setDefault("Close");
var fp2 = new FunctionParameter("vOffset", FunctionParameter.NUMBER);
fp2.setDefault(-1);
var fp3 = new FunctionParameter("vSource2", FunctionParameter.STRING);
fp3.setName("Short Source");
fp3.addOption("Strategy.MARKET");
fp3.addOption("Strategy.CLOSE");
fp3.addOption("Strategy.LIMIT");
fp3.addOption("Strategy.STOP");
fp3.setDefault("Strategy.CLOSE");
}
function main(vSource, vOffset, vSource2) {
drawShapeRelative(0, vSource(vOffset), Shape.DIAMOND, null, Color.brown, Shape.BOTTOM);
Strategy.doShort("SHORTopen", vSource2, Strategy.THISBAR);
return;
}
Comment