Hi I've come across a weird issue. I have a NUMBER input showing a BOOLEAN checkbox when I go to run it in the back tester. It works fine when applied to an advanced chart. Here is a screen cap. I've checked over and over the code. I don't see what would be causing that. I think it may be a genuine bug. Below cap is the code.
PHP Code:
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
// setComputeOnClose(); //Study needs to update on ticks for stop/targets. Enclose in barstatenewbar for onclose funcitons
// Right now script does some loopy stuff at 9:00 on tick replay when this is commented out.. hanis!
setPriceStudy(true);
setStudyTitle("Base Strategy BETA 1.96 IB!");
setColorPriceBars(false);
setIntervalsBackfill(true);
setShowTitleParameters(false);
setCursorLabelName("Stop", 0);
setCursorLabelName("Target", 1);
setCursorLabelName("Entry", 2);
setDefaultBarFgColor(Color.red, 0); // Stop color
setDefaultBarFgColor(Color.aqua, 1); // Target color
setDefaultBarFgColor(Color.white, 2); // Entry Price
setDefaultBarThickness(2, 0); // Stop Thickness
setDefaultBarThickness(2, 1); // Target Thickness
setDefaultBarThickness(2, 2); // Entry Thickness
setPlotType(PLOTTYPE_FLATLINES, 0); // Stop plot type
setPlotType(PLOTTYPE_FLATLINES, 1); // Target plot type
setPlotType(PLOTTYPE_FLATLINES, 2); // Entry plot type
// SET SOME USEFUL VARIALBES UP
AllowTrading = true;
symb = new String(getSymbol() );
nStop = 0;
nTarget = 0;
size = 0;
EntryPrice = 0;
ExitDay = 0;
Lastout = "green";
EntryPrice = 0;
EntryTime = 0;
ExitPrice = 0; // Price last stop exited
ExitTime = 0; // Time last stop executed
RedCount = 1;
vLastAlert = -1;
dcounter = 1;
bTargetBreach = false;
bInit = false; // initialization flag
closed = 0;
lstexec = 0; // geoff - added to count trades
totlpts = 0; // geoff added to count total plus or minus pts
trades = 0; // geoff
dreset = 1; // geoff added sept 13th
pnl = 0;
// Below are the dynamic variables passed from the edit studies configure menu.
var gTimer = new FunctionParameter("gTimer", FunctionParameter.NUMBER);
gTimer.setDefault( 0 );
gTimer.setName("Close trades after x min");
var gStop = new FunctionParameter("gStop", FunctionParameter.NUMBER);
gStop.setDefault(100); // 25 Seems good
gStop.setName("Hard Stop");
var gTarget = new FunctionParameter("gTarget", FunctionParameter.NUMBER);
gTarget.setDefault( 20 );
gTarget.setName("Profit Target 1");
var gInc = new FunctionParameter("gInc", FunctionParameter.NUMBER);
gInc.setDefault( 100 );
gInc.setName("Trail Stop Incriment");
var gPare1 = new FunctionParameter("gPare1", FunctionParameter.STRING);
gPare1.addOption("all");
gPare1.addOption("half");
gPare1.addOption("keep");
gPare1.addOption("3forths");
gPare1.setDefault( "3forths" );
gPare1.setName("Pare out shares at target?");
var gBreakeven = new FunctionParameter("gBreakeven", FunctionParameter.BOOLEAN);
gBreakeven.setDefault( false );
gBreakeven.setName("Breakeven stop on target 1 hit? ");
var gOffset = new FunctionParameter("gOffset", FunctionParameter.NUMBER);
gOffset.setDefault( -5 );
gOffset.setName("BE Offset (only if above checked)");
var gRed = new FunctionParameter("gRed", FunctionParameter.NUMBER);
gRed.setDefault( 99 );
gRed.setName("Cease trading at x RED trades in-a-row");
var gWait = new FunctionParameter("gWait", FunctionParameter.NUMBER);
gWait.setDefault( 1 );
gWait.setName("Wait x min aftr STOP b4 new trade");
var gAllin = new FunctionParameter("gAllin", FunctionParameter.BOOLEAN);
gAllin.setDefault( false );
gAllin.setName("ALL IN Strategy? (overrides above options)");
var gModdy = new FunctionParameter("gModdy", FunctionParameter.BOOLEAN);
gModdy.setDefault( false );
gModdy.setName("Modify lot size on Monday/Friday?");
var gDz = new FunctionParameter("gDz", FunctionParameter.BOOLEAN);
gDz.setDefault( false );
gDz.setName("Skip deadzone trading");
var gDzexit = new FunctionParameter("gDzexit", FunctionParameter.BOOLEAN);
gDzexit.setDefault( false );
gDzexit.setName("Exit open trades at NOON");
var gEOD = new FunctionParameter("gEOD", FunctionParameter.BOOLEAN);
gEOD.setDefault( true );
gEOD.setName("Exit trades EOD");
var gTest = new FunctionParameter("gTest", FunctionParameter.BOOLEAN);
gTest.setDefault( true );
gTest.setName("TEST MODE? (no broker trades) ");
var pSize = new FunctionParameter("pSize", FunctionParameter.NUMBER);
pSize.setName("Default Lot Size");
pSize.setLowerLimit(1);
pSize.setDefault(4);
var gPnl = new FunctionParameter("gPnl", FunctionParameter.BOOLEAN);
gPnl.setDefault( true );
gPnl.setName("Show estimated P&L? ");
var gBT = new FunctionParameter("gBT", FunctionParameter.BOOLEAN);
gBT.setDefault( false );
gBT.setName("Back Tester Compability Mode?");
}
function main( gTimer, gStop, gTarget, gInc, gPare1, gBreakeven, gOffset, gRed, gWait, gAllin, gModdy, gDz, gDzexit, gEOD, gTest, pSize, gPnl, gBT )
{ // Start beautiful block of main code
Comment