As I commented to Alter this weekend I started to collect information on AmiBroker
,
I downloaded everything I've been finding out about installation, programming and automation strategies. By now surely everyone cononcerĂ¡ this program for those who do not know or want to deepen their study leave here a series of links that I found that are serving me to learn the operation.
INSTALLATION INFORMATION: In X-Trader is an excellent manual translated into Castilian in explaining what are the requirements to install it, also explains the steps to be followed for let plotting data received from the TWS. Installation Manual (Castilian X-Trader)
Some of the symbols that can plot free of TWS are:
EMDM7-GLOBEX-FUT = Future of e-mini S & P MID CAP 400 / June VTO ER2M7-GLOBEX-FUT = Future of e-mini Russell 2000 / June ESM7 VTO-GLOBEX-FUT = Future of e-mini S & P 500 / VTO June
QMM7-NYMEX-FUT = Future Mini Petrol / VTO June 07-JUN ECBOT YG mini-FUT = Future Gold / VTO June YM JUN 07-ECBOT-FUT = Future Mini DJA / VTO June For other symbols
here is an explanation of how to configure them (English). PROGRAMMING INFORMATION AFL:
Here the plot thickens a bit, there is no manual translated into Castilian in explaining the functions and basic instructions for programming. In this case I only found the manual in the official website and some examples of their library.
AFL Programming Manual (English AmiBroker) AFL Library (English AmiBroker)
Also once installed AmiBroker support are examples of how it should use all the features.
INFORMATION AUTOMATION STRATEGIES:
I have not found much information about this topic, the truth is that I imagined I would find more examples, however there are some tips that can serve to introduce it.
to send commands manually Manual (Castilian X-Trader)
IB Manual Controller (English AmiBroker)
Group Yahoo.
- Finally Forum X-Trader in the software section
- we are some examples that have been posting Ahmose and to provide guidance strada.
To break the ice and see if IB Controler works ( Interface for sending orders to TWS)
you upload the following code that you can copy and paste the Formula Editor window AmiBroker.
- SYSTEM COMPARISON OF CLOSURES:
- purchase ////// Condition
- Buy = Ref (C, -1)> Ref (C, -2);
if (LastValue (Buy)) {
if (ibc.GetPositionSize (Name ()) == -1)
{OrderID = StaticVarGetText ("OrderID" + Name ()); OrderID = ibc.ModifyOrder (OrderID, Name (), "Buy", 2, "MKT", 0, 0, "Day "True )
StaticVarSetText (" OrderID "+ Name (), OrderID);
}}}
sales ////// Condition
Sell = Ref (C, -1) Ref (C, -2);
if (LastValue (Sell))
{
ibc = GetTradingInterface("IB");
if( ibc.IsConnected() )
{
if( ibc.GetPositionSize( Name() ) == 1 )
{
< OrderID = StaticVarGetText("OrderID"+Name());
OrderID = ibc.ModifyOrder( OrderID, Name(), "sell", 2, "MKT", 0, 0, "Day", True ); StaticVarSetText("OrderID"+Name(), OrderID);
}
}}
This system will do is buy 2 contracts when today's close is greater than yesterday's close, if the condition is not sell 2 contracts are met. In this way we develop a continuous system that is always in the market.
Note * The IBC allows you to set orders in the TWS before transmission, this is achieved with a safety mechanism that requires the supervision of each order before of a manual transmission. As this example system will transmit all orders without supervision, in case you want to do a manual transmission just change in the two parts of the code word "True " the word "False" .
Once you compile the system and insert it on the graph we see that not issue any orders to TWS. This happens because as a continuous system needs to have an open position to reinvest, so before putting the system to work we should manually run the position you have at that time. to run commands manually from the TWS have to go to order and that it will be opened a window like this:
If you set exactly what seen in the example would launch a purchase order for a contract on June Vto the future of e-mini S & P MID CAP 400 Globex. Otherwise we should set the terms of the contract that we want to implement the system.
Once the TWS have the same position as our system we can insert it on the chart and see how orders are executed automatically. For now that's it, I look forward to sharing emerging research on this program the more I know I like :-)
Greetings David
0 comments:
Post a Comment