I have the following edit menu in premain. Whenever I change a value with the edit menu, the script goes lame: nothing happens but there is no error message in debugPrintln.
If I remove the script, edit it with the (same as above) new value and load it, everything function as it should.
Is there a limit to the number of submenus?
Thank you in advance.
Andrei
var vInit = 0;
function preMain()
{
if (vInit == false)
{
var fp1 = new FunctionParameter("s_name", FunctionParameter.STRING);
fp1.setName("Symbol Name?");
fp1.setDefault("ET");
var fp2 = new FunctionParameter("s_type", FunctionParameter.STRING);
fp2.setName("Symbol Type?");
fp2.setDefault("FUT");
var fp3 = new FunctionParameter("s_exp", FunctionParameter.NUMBER);
fp3.setName("Symbol Expiry?");
fp3.setDefault( 200403 );
var fp4 = new FunctionParameter("s_right", FunctionParameter.NUMBER);
fp4.setName("Put/Call Info?");
fp4.setDefault("");
var fp5 = new FunctionParameter("s_strike", FunctionParameter.NUMBER);
fp5.setName("Strike Price?");
fp5.setDefault( 0 );
var fp6 = new FunctionParameter("s_exch", FunctionParameter.STRING);
fp6.setName("Exchange?");
fp6.setDefault("EUREX");
var fp7 = new FunctionParameter("s_curr", FunctionParameter.NUMBER);
fp7.setName("Currency?");
fp7.setDefault("EUR");
var fp8 = new FunctionParameter("num_contracts", FunctionParameter.NUMBER);
fp8.setName("Lots?");
fp8.setDefault( 3 );
var fp9 = new FunctionParameter("profit_target", FunctionParameter.NUMBER);
fp9.setName("Profit Target (pts)?");
fp9.setDefault( 15.00 );
var fp10 = new FunctionParameter("use_stop_loss", FunctionParameter.BOOLEAN);
fp10.setName("with Stop Loss or SAR?");
fp10.setDefault(false);
var fp11 = new FunctionParameter("use_trailing_stop", FunctionParameter.BOOLEAN);
fp11.setName("Trailing or Fixed Stop?");
fp11.setDefault(false);
var fp13 = new FunctionParameter("stop_loss", FunctionParameter.NUMBER);
fp13.setName("Fixed Stop Loss (pts)?");
fp13.setDefault( -8.00 );
var fp14 = new FunctionParameter("trail_loss", FunctionParameter.NUMBER);
fp14.setName("Trailing Stop (pts)?");
fp14.setDefault( 8.00 );
var fp15 = new FunctionParameter("use_limit_orders", FunctionParameter.BOOLEAN);
fp15.setName("Use Limit/Market Orders?");
fp15.setDefault(false);
var fp16 = new FunctionParameter("day_open", FunctionParameter.NUMBER);
fp16.setName("Beginning Day?");
fp16.setLowerLimit( 0000 );
fp16.setUpperLimit( 2400 );
fp16.setDefault( 0004 );
var fp17 = new FunctionParameter("day_close", FunctionParameter.NUMBER);
fp17.setName("Ending Day?");
fp17.setLowerLimit( 0000 );
fp17.setUpperLimit( 2400 );
fp17.setDefault( 828 );
var fp18 = new FunctionParameter("daily_profit", FunctionParameter.NUMBER);
fp18.setName("Daily Profit Target (pts)");
fp18.setDefault(90);
var fp19 = new FunctionParameter("daily_loss", FunctionParameter.NUMBER);
fp19.setName("Max. Daily Loss (pts)");
fp19.setDefault(30);
var fp20 = new FunctionParameter("Length1", FunctionParameter.NUMBER);
fp20.setLowerLimit(1);
fp20.setDefault(10);
var fp21 = new FunctionParameter("Offset1", FunctionParameter.NUMBER);
fp21.setDefault(0);
var fp22 = new FunctionParameter("Source1", FunctionParameter.STRING);
fp22.setName("Source");
fp22.addOption("Close");
fp22.addOption("High");
etc. up to fp27
}
}
If I remove the script, edit it with the (same as above) new value and load it, everything function as it should.
Is there a limit to the number of submenus?
Thank you in advance.
Andrei
var vInit = 0;
function preMain()
{
if (vInit == false)
{
var fp1 = new FunctionParameter("s_name", FunctionParameter.STRING);
fp1.setName("Symbol Name?");
fp1.setDefault("ET");
var fp2 = new FunctionParameter("s_type", FunctionParameter.STRING);
fp2.setName("Symbol Type?");
fp2.setDefault("FUT");
var fp3 = new FunctionParameter("s_exp", FunctionParameter.NUMBER);
fp3.setName("Symbol Expiry?");
fp3.setDefault( 200403 );
var fp4 = new FunctionParameter("s_right", FunctionParameter.NUMBER);
fp4.setName("Put/Call Info?");
fp4.setDefault("");
var fp5 = new FunctionParameter("s_strike", FunctionParameter.NUMBER);
fp5.setName("Strike Price?");
fp5.setDefault( 0 );
var fp6 = new FunctionParameter("s_exch", FunctionParameter.STRING);
fp6.setName("Exchange?");
fp6.setDefault("EUREX");
var fp7 = new FunctionParameter("s_curr", FunctionParameter.NUMBER);
fp7.setName("Currency?");
fp7.setDefault("EUR");
var fp8 = new FunctionParameter("num_contracts", FunctionParameter.NUMBER);
fp8.setName("Lots?");
fp8.setDefault( 3 );
var fp9 = new FunctionParameter("profit_target", FunctionParameter.NUMBER);
fp9.setName("Profit Target (pts)?");
fp9.setDefault( 15.00 );
var fp10 = new FunctionParameter("use_stop_loss", FunctionParameter.BOOLEAN);
fp10.setName("with Stop Loss or SAR?");
fp10.setDefault(false);
var fp11 = new FunctionParameter("use_trailing_stop", FunctionParameter.BOOLEAN);
fp11.setName("Trailing or Fixed Stop?");
fp11.setDefault(false);
var fp13 = new FunctionParameter("stop_loss", FunctionParameter.NUMBER);
fp13.setName("Fixed Stop Loss (pts)?");
fp13.setDefault( -8.00 );
var fp14 = new FunctionParameter("trail_loss", FunctionParameter.NUMBER);
fp14.setName("Trailing Stop (pts)?");
fp14.setDefault( 8.00 );
var fp15 = new FunctionParameter("use_limit_orders", FunctionParameter.BOOLEAN);
fp15.setName("Use Limit/Market Orders?");
fp15.setDefault(false);
var fp16 = new FunctionParameter("day_open", FunctionParameter.NUMBER);
fp16.setName("Beginning Day?");
fp16.setLowerLimit( 0000 );
fp16.setUpperLimit( 2400 );
fp16.setDefault( 0004 );
var fp17 = new FunctionParameter("day_close", FunctionParameter.NUMBER);
fp17.setName("Ending Day?");
fp17.setLowerLimit( 0000 );
fp17.setUpperLimit( 2400 );
fp17.setDefault( 828 );
var fp18 = new FunctionParameter("daily_profit", FunctionParameter.NUMBER);
fp18.setName("Daily Profit Target (pts)");
fp18.setDefault(90);
var fp19 = new FunctionParameter("daily_loss", FunctionParameter.NUMBER);
fp19.setName("Max. Daily Loss (pts)");
fp19.setDefault(30);
var fp20 = new FunctionParameter("Length1", FunctionParameter.NUMBER);
fp20.setLowerLimit(1);
fp20.setDefault(10);
var fp21 = new FunctionParameter("Offset1", FunctionParameter.NUMBER);
fp21.setDefault(0);
var fp22 = new FunctionParameter("Source1", FunctionParameter.STRING);
fp22.setName("Source");
fp22.addOption("Close");
fp22.addOption("High");
etc. up to fp27
}
}
Comment