Basically the code is:
if(x>y)
{
EnterLong(25,000, "L1") ;
} else {
EnterShort(25,000,"S1") ;
}
I'm using IB as a broker and below is a trace of the last order (was Long):
11/30/2009 06:15 Position Instrument='$GBPUSD' Avg price=0 Quantity=0 Market position=Long Operation=Remove Currency=UsDollar
11/30/2009 06:15 Execution Execution='$GBPUSD/0000d344.9625eb61.01.01' Instrument='$GBPUSD' Exchange=IBIdealPro Price=1.6476 Quantity=25000 Market position=Short Operation=Insert Order='892541465' Time='11/30/2009 06:14:59' Multiplier=1E-05
11/30/2009 06:15 Order Order='892541465' Name='S1' New State=Filled Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=25000 Fill price=1.6476 Error=NoError Native error=''
11/30/2009 06:14 Order Order='892541465' Name='S1' New State=Working Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
11/30/2009 06:14 Order Order='892541465' Name='S1' New State=Accepted Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
11/30/2009 06:14 Default Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed. 2109
11/30/2009 06:14 Order Order='NT-00060' Name='S1' New State=PendingSubmit Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
Comment