Quote from giles117:
They wont reject your post... It's an honest question....
Beware, C = Close in AFL
the basic syntax is this
a1 = value;
b1 = value;
c1 = value;
lastprice = Close;
if lastprice = (a1+b1);
{
condition 2;
}
That is the basic syntax.... Need the rest of the formula to properly write condition 2
In order for condition 2 to exist where are you generating the buy/sell order????
Thanks

i still cannot see my post at the yahoo group. well never mind.
So do you mean i can put another "if" statement inside the first one?
llike this:
if lastprice = (a1+b1);
{
if LASTPRICE = (a1+B1);
{ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
}
}
THE REST OF THE FORMULA IS LIKE THIS:
_SECTION_BEGIN("SYS50");
//SETTING
A1 = 50;
B1 = 50;
C1 = 50;
D1 = 50;
//param trigger button to reset status
resetStatus = ParamTrigger("resetStatus","resetStatus");
//START
DateNumNow = Now(3);
DN = DateNum();
TN = TimeNum();
//check if order placed
OrderPlaced = StaticVarGet("OrderPlaced");
if(resetStatus)
{
StaticVarSet("OrderPlaced",0);
}
OrderPlaced = StaticVarGet("OrderPlaced");
//check if order is triggered, place order if condition fullfiled
if( (IsEmpty(OrderPlaced) OR OrderPlaced==0) )
{
ibc = GetTradingInterface("IB");
IBcStatus = ibc.IsConnected();
if( IBcStatus )
{
//Long side, place order
StaticVarSet("OrderPlaced",1);
LimitBuy = D1+A1;
parentIDLong = ibc.PlaceOrder(Name(), "BUY", 1, "LMT", LimitBuy, 0, "DAY", False );
ibc.PlaceOrder(Name(), "SELL", 1, "LMT", LimitBuy+B1, 0, "DAY", False, 1, "", parentIDLong );
ibc.PlaceOrder(Name(), "SELL", 1, "TRAIL", C1, C1, "DAY", True, 1, "", parentIDLong );
//short side, place order
LimitSell = D1+B1;
parentIDShort = ibc.PlaceOrder(Name(), "SELL", 1, "LMT", LimitSell, 0, "DAY", False );
ibc.PlaceOrder(Name(), "BUY", 1, "LMT", LimitSell-D1, 0, "DAY", False, 1, "", parentIDShort );
ibc.PlaceOrder(Name(), "BUY", 1, "TRAIL", C1, C1, "DAY", True, 1, "", parentIDShort );
}
}