Friday 22 September 2017

Lmt Forex Formula Download


AmiBroker interfaccia Auto-Trading di Interactive Brokers 1.3.8 Beta Leggimi 29 Maggio 2014 21:03 Questa è una versione beta del software (vedere la sezione FAQ per un quotwhy risposta è contrassegnata come BETA quot) TRADING AUTOMATICO PORTA certi rischi. SI PREGA DI VERIFICARE ATTENTAMENTE IL CODICE UTILIZZO PRIMA TWS DEMO ed allora carta Conto Trading trading automatico Inteface lo scopo di rendere più facili gli scambi e veloce MA NON INTENDE essere eseguito senza supervisione. Non lasci automatici INCUSTODITO AS alcune circostanze possono VERIFICARSI come l'insufficienza INTERNET, INTERRUZIONE, altra situazione imprevisti che possono portare a gravi perdite finanziarie. Basta eseguire il programma di installazione e seguire le istruzioni. Vedere CHANGE LOG di seguito per l'elenco dettagliato delle modifiche. AmiBroker 4.70 o superiore. Consigliato AmiBroker 5,30 soprattutto su Vista e Windows 7. workstation TWS (DEMO, PaperTrading è OK) da interactivebrokers. versione preferita: 907 o superiore. NON usare TWS versione 945.1 - è pieno di bug, in particolare versione web. Il controller IB (BrokerIB. EXE) è un'applicazione separata che funge da cuscinetto tra AmiBroker e Interactive Brokers TWS. Si accetta comandi da AmiBroker ed inviare gli ordini recupera informazioni da TWS. Consente inoltre di canceltransmit ordini manualmente. L'applicazione del controller IB è gestito automaticamente dal AmiBroker se la formula contiene il seguente invito: Dopo questa chiamare il BrokerIB. EXE (IB Controller) applicazione viene avviata e la variabile IBC contiene il puntatore oggetto di automazione OLE che ha diversi metodi (funzioni) che permettono di placemodifycancel ordini via TWS e per interrogare le informazioni del portafoglio. Tali metodi (funzioni) sono chiamati come i metodi oggetto di automazione, per esempio: se (ibc. IsConnected ()) controllare se la connessione al IB era successo ibc. PlaceOrder (quotMSFTquot, quotBUYquot, 100, quotMKTquot, 0, 0, quotDAYquot, False ) ordine del posto, ma non trasmettono ancora noti che questo è l'interfaccia di basso livello per gli utenti avanzati che viene reso disponibile nella cosiddetta fase di implementazione un trading automatico tramite IB. Ci saranno un'interfaccia di alto livello che sarà realizzato in seguito. IB Metodi Controller (funzioni): Questa funzione pone un nuovo ordine La funzione restituisce il OrderId (stringa) che può essere poi utilizzato per modifycancelquery stato dei parametri di ordine: Ticker - stringa che specifica il simbolo del securitycontract da acquistare. Il simbolo deve seguire la simbologia definita in dettaglio: amibrokerib. html Azione - specifica azione da intraprendere, i valori possibili sono: quotBUYquot, quotSELLquot, quotSSHORTquot Quantità - il numero di sharescontracts per buysell tipo - specifica il tipo di ordine, i valori possibili sono: quotMKTquot , quotMKTCLSquot, quotLMTquot, quotLMTCLSquot, quotPEGMKTquot, quotSTPquot, quotSTPLMTquot, quotTRAILquot, quotRELquot, quotVWAPquot - consultare la documentazione di Interactive Brokers TWS per ulteriori informazioni sui tipi di ordine LimitPrice - questo definisce il prezzo limite per il limite e stop ordini limite StopPrice - questo definisce ferma prezzo per ordini stop TimeInForce - definisce il tempo in vigore del provvedimento, i valori possibili sono: quotDAYquot, quotGTCquot, quotIOCquot, quotGTDquot partire da v1.0.8 campo TimeInForce in PlaceOrderModifyOrder accetta GTD e GAT specifiche GTD - valida fino alla data - indica che l'ordine dovrebbe rimanere workign fino alla data e l'ora impostata. Good Till specifica Data GTD AAAAMMGG HH: MM: SS TZONE dove: AAAA è quattro anni cifre MM è due mesi cifre DD è due giorni cifre HH è 2 ore cifre MM è 2 cifre minuto SS è 2 seconda cifra (OPTIONAL) TZONE è il tempo zona (opzionale) Dopo aver specifiche TimeInForce regolari (giorno, GTC, GTD) è possibile aggiungere ulteriore GoodAfterTime parte (GAT). GAT parte viene dopo punto e virgola. Esso indica che il commercio dovrebbe essere presentata dopo la data e l'ora impostata: DAYGAT AAAAMMGG HH: MM: SS TZONE - fine giornata valida dopo specificato datetime GTCGAT AAAAMMGG HH: MM: SS TZONE - buono fino ordine annullato valide dopo il periodo di tempo specificato hh GTD AAAAMMGG: mm: ss tzoneGAT YYYYYMMDD HH: mM: SS TZONE - ordine GTD valide dopo il periodo di tempo specificato dove: AAAA è quattro anni cifre mM è due mesi cifre DD è due giorni cifre HH è 2 ore cifre mM è a 2 cifre minuto SS è seconda a 2 cifre (OPTIONAL) TZONE è il fuso orario (opzionale) Nota: ci deve essere spazio tra i carattere punto e virgola e la stringa GAT. ibc. PlaceOrder (MSFT ACQUISTA 100. LMT 27. 0. DAYGAT 20.051.214 18:00:00 GMT True....) -. limit order giorno buono dopo dicembre 14,2005, 18:00 GMT ibc. PlaceOrder (MSFT BUY. 100. LMT 27. 0. GTD 20.051.215 17:00:00 GMTGAT 20.051.214 18:00:00 GMT true) -.. ordine limite valido da dicembre 14,2005 18:00 alle Dicembre 15,2005 17:00 GMT ibc. PlaceOrder (. MSFT BUY 100. LMT 27. 0. GTD 20.051.215 19:00:00 GMT vero...) - ordine limite valida da oggi fino al dicembre 15,2005 19:00 GMT Transmit - flag booleano che specifica se dato ordine dovrebbe essere effettivamente trasmessa allo scambio. Se questo flag è impostato su FALSE, allora ordine NON trasmesso ma viene visualizzato nella workstation TWS in modo da poter premere trasmettere parametri lateradditional manualmente per IBController 1.0.4 o superiore: TickSize - definisce minima fluttuazione dei prezzi consentito per data simbolo espressi in pips (0,0001 ). Per la maggior parte degli stock noi è 100 (rappresenta 0.01 mossa), per la maggior parte delle valute: 1 (0.0001 rappresenta mossa), se la mossa minimo è inferiore a 0,0001 è possibile utilizzare valori frazionari per esempio 1100 0.000001 parametri move. additional per IBController 1.0.8 o superiore: attributi - è una stringa che permette di specificare gli attributi di ordine supplementari (lista separata da virgole).outsideRTH - se specificato significa che ordine si innescherà, non solo durante le ore regolare andamento delle negoziazioni (RTH), ma anche nel commercio esteso (mercato preafter) questo si applica a fermare gli ordini, ordini condizionati, e le segnalazioni che viene utilizzato dalla logica di attivazione. Se non specificato (falsi) gli ordini attiveranno solo durante RTH. allOrNone - riempire tutto o niente affatto eTradeOnly - commercio con citazioni elettronici solo firmQuoteOnly - commercio con la ditta quotazioni solo bandiere versione 1.1 ignoreRth rthOnly sono obsoleti ora e non supportati come TWS API abbandonato il supporto per quelli. Per impostazione predefinita, tutte quelle bandiere sono inattivi (OFF) Esempio: ibc. PlaceOrder (. MSFT BUY 1000. LMT 27. 0. GTD 20.051.215 19:00:00 GMT Vero 100. allOrNone....) (Si noti che il parametro opzionale TickSize MUST specificare se si desidera utilizzare gli attributi) ParentID - è una stringa che specifica identificatore fine genitore (restituito dalla precedente chiamata PlaceOrder) consentendo di effettuare ordini staffa. parentID ibc. PlaceOrder (MSFT. BUY. 1000. LMT. 27. 0. GTC. False) ibc. PlaceOrder (MSFT. vendere. 1000. LMT. 28. 0. GTC. Falso. 100.. parentID) ibc. PlaceOrder ( MSFT. vendere. 1000. STP. 26. 26. GTC. vero. 100.. parentID) Nota che trasmettono flag è impostato su FALSE su tutti gli ordini staffa tranne l'ultimo. Questo assicura che gli ordini attendere set ordine staffa è completata. L'impostazione di trasmissione bandiera TRUE sul molto ultimo trasmette tutta la staffa. OCAGroup - parametro stringa opzionale (di nuovo in 1.1.0) che permette di definire OCA (One-Annulla-All) gruppo di ordini OCA ordini gruppo di lavoro in congiunzione con gli altri in modo che quando viene eseguito un ordine all'interno del gruppo i rimanenti ordini vengono annullati . Per maggiori informazioni vedi: interactivebrokersphpwebhelpMakingTradesCreateOrderTypesoca. htmExample: ibc. PlaceOrder (. MSFT VENDERE 1000. LMT 28. 0. GTC Vero 100. 0. MYGROUP.....) Ibc. PlaceOrder (MSFT VENDERE 1000. STP 26.... 26. GTC vero 100. 0. MYGROUP) OCAType -... parametro numerico opzionale (di nuovo in 1.1.0) che permette di controllare il modo in cui gli ordini OCAGroup sono gestite quando un ordine nel gruppo è parzialmente riempita. I valori possibili sono: 1 CANCELWITHBLOCK - altri ordini vengono annullati 2 REDUCEWITHBLOCK - altri ordini vengono ridotti in dimensioni e protezione di troppo pieno è il 3 REDUCENONBLOCK - altri ordini vengono ridotti in dimensioni e protezione di troppo pieno è OFF valore predefinito è 3 FAParams - parametro stringa opzionale (nuova in 1.1.0) - per l'uso con FA (Consulente finanziario aka FamilyampFriends) conti. Permette di specificare l'account FA gruppo di allocazione, il profilo, il metodo e la percentuale. Questi quattro parametri devono essere forniti come stringa separata e virgola: quotFAGroupFAProfileFAMethodFAPercentagequot. Se qualche parametro non è necessario può essere lasciato vuoto, ma è necessario mantenere un punto e virgola se ci sono ulteriori parametri richiesti. Ad esempio, per specificare l'ordine che usa gruppo quotAllquot e utilizza il metodo quotEqualQuantityquot il FAParameter dovrebbe essere simile a questo: quotAllEqualQuantityquot:....... Ibc. PlaceOrder (MSFT BUY 1000. LMT 27. 0. GTC Vero 100. 0. 0. AllEqualQuantity) Se si desidera utilizzare il profilo di assegnazione personalizzato è possibile utilizzare:....... ibc. PlaceOrder (MSFT BUY 1000. LMT 27. 0. GTC vero 100. 0. 0. AllMyCustomProfile) Se FAParams non è previsto e si utilizza conto FA di IBC utilizzerà l'assegnazione di default di quotAllAvailableEquityquot si noti che per impostazione predefinita IB controller accede in considerazione quotAllquot che è quotaggregatequot, cioè tiene la somma di tutte le posizioni su tutti i sub-account. Account - parametro opzionale stringa (di nuovo in 1.3.5) - per l'uso con FA (Financial Advisor aka FamilyampFriends) accounts. This permette di specificare l'account di destinazione per l'ordine per i conti FampFFA IB in unica convocazione, invece di affidarsi a sequenza SetAccountPlaceOrder. Singolo-call PlaceOrderModifyOrder con la specifica considerazione permette di specificare l'account senza preoccuparsi che altri threadsprocesses possono passare i conteggi tra SetAccount () e PlaceOrder (). ModifyOrder (string OrderId. Stringa di Ticker. Stringa di azione. Numero di quantità. Stringa tipo. Numero LimitPrice. Numero StopPrice. Stringa TimeInForce. Bool di trasmissione, numero opzionale TickSize 100, stringa opzionale Attributi quotquot, opzionale quotquot stringa ParentID. Stringa opzionale OCAGroup. Numero opzionale OCAType. stringa opzionale FAParam. opzionale account stringa) Questa funzione modifica l'ordine che è stato posto prima, ma non ancora riempito. Questa funzione può essere utilizzata anche per modificare gli ordini che sono stati inviati con quotTransmitquot bandiera impostato su False. Anche quando il parametro IDOrdine è vuota questa funzione funziona esattamente come PlaceOrder (in modo da poter inserire e modificare ordini utilizzando ModifyOrder () solo funzione) La funzione restituisce il OrderId (stringa) che può essere poi utilizzato per modifycancelquery stato dei parametri di ordine: OrderId - stringa che specifica il orderID di essere modificati (restituito dal precedente PlaceOrder o chiamata ModifyOrder). Se questo parametro è vuoto, la funzione inserisce un nuovo ordine tutti i rimanenti parametri sono gli stessi in funzione PlaceOrder Nella versione 1.1.0 un miglioramento è stato aggiunto alla funzione ModifyOrder che se alcuni dei parametri facoltativi come ParentID, OCAGroup, OCAType, FAParam sono non specificato - valori allora utilizza precedentemente fornite (durante PlaceOrder). Questo impedisce ad esempio perdere ParentID quando si chiama ModifyOrder su un ordine bambino senza parentID currect. Questa funzione annulla ordine pendente. Vero - se l'ordine pendente è stato trovato e annullare richiesta è stata inviata, False - se non esiste un ordine in sospeso con i parametri specificati OrderID: OrderId - stringa che specifica il orderID da modificare (restituito dal precedente PlaceOrder o chiamata ModifyOrder). GetAccountValue (string FieldName) Questa funzione recupera i valori di conto. Stringa che rappresenta il valore. Si noti che se avete bisogno di numero in AFL si dovrebbe utilizzare la funzione di conversione StrToNum che convertirà stringa restituita da questa funzione al numero. stringa vuota viene restituita se il campo non esiste o è vuoto. Parametri: FieldName - definisce il valore di interrogare elenco dei campi disponibili (maiuscole e minuscole): 1. I campi che sono o di valuta-indipendente o espressi in conto in valuta base (di solito ammonta): accountcode AccountReady AccountType AccruedCash CashBalance valuta DayTradesRemaining DayTradesRemainingT1 DayTradesRemainingT2 DayTradesRemainingT3 DayTradesRemainingT4 ExchangeRate FuturesPNL Leverage-S LookAheadNextChange NetLiquidationByCurrency OptionMarketValue PNL RealizedPnL StockMarketValue TotalCashBalance UnrealizedPnL 2. I campi che sono forniti separatamente per ciascuna valuta tenuto il conto, CUR nella lista qui sotto indica il simbolo di valuta, in modo da per USD denominati in fondi e titoli vedrete USD prefisso. Nota posizioni IDEALPRO spot forex sono compresi nel CURCashBalance qui. CURAccruedCash CURAccruedCash-C CURAccruedCash-S CURAvailableFunds CURAvailableFunds-C CURAvailableFunds-S CURBuyingPower CURCashBalance CURCurrency CUREquityWithLoanValue CUREquityWithLoanValue-C CUREquityWithLoanValue-S CURExcessLiquidity CURExcessLiquidity-C CURExcessLiquidity-S CURFullAvailableFunds CURFullAvailableFunds-C CURFullAvailableFunds-S CURFullExcessLiquidity CURFullExcessLiquidity-C CURFullExcessLiquidity-S CURFullInitMarginReq CURFullInitMarginReq-C CURFullInitMarginReq - S CURFullMaintMarginReq CURFullMaintMarginReq-C CURFullMaintMarginReq-S CURFutureOptionValue CURFuturesPNL CURGrossPositionValue CURGrossPositionValue-S CURInitMarginReq CURInitMarginReq-C CURInitMarginReq-S CURLeverage-S CURLookAheadAvailableFunds CURLookAheadAvailableFunds-C CURLookAheadAvailableFunds-S CURLookAheadExcessLiquidity CURLookAheadExcessLiquidity-C CURLookAheadExcessLiquidity-S CURLookAheadInitMarginReq CURLookAheadInitMarginReq-C CURLookAheadInitMarginReq-S CURLookAheadMaintMarginReq CURLookAheadMaintMarginReq-C CURLookAheadMaintMarginReq-S CURLookAheadNextChange CURMaintMarginReq CURMaintMarginReq-C CURMaintMarginReq-S CURNetLiquidation CURNetLiquidationByCurrency CURNetLiquidation-C CURNetLiquidation-S CURPreviousDayEquityWithLoanValue CURPreviousDayEquityWithLoanValue-S CUROptionMarketValue CUROptionMarketValue CURRealizedPnL CURSMA CURSMA-S CURStockMarketValue CURTotalCashBalance CURTotalCashValue CURTotalCashValue-C CURTotalCashValue-S CURUnalteredInitMarginReq CURUnalteredMaintMarginReq CURUnrealizedPnL Quando la valuta non è specificato IBC primi sguardi per i valori specificati nella valuta di base e se non si trova poi usa USD come predefinita, in modo da poter usare vecchio stile GetAccountValue (quotAvailableFundsquot) e restituirà la stessa GetAccountValue (quotUSDAvailableFundsquot) - perché non c'è fondi disponibili non sono specificati nella valuta di base. Se invece chiama GetAccountValue (quotTotalCashBalancequot) si segnala in valuta di base e può essere diverso da GetAccountValue (quotUSDTotalCashBalancequot), che rappresenterà USD solo contanti. Le differenze si verificheranno se si dispone di posizioni di liquidità a molte valute in modo quotbasequot moneta mostra totale lordo di tutte le posizioni in tutte le valute come se fossero scambiati nella valuta di base GetExecInfo (stringa OrderId,. Stringa Field) Questa funzione recupera il valore del campo di OrderId ordinare dalla lista di esecuzione il valore numerico o puntura del campo richiesto per OrderId. Null se nessun campo o no tale posizione disponibili Parametri: OrderId - stringa che specifica l'ordine (restituito dalla funzione PlaceOrder o recuperato da GetExecList). Campo - uno dei nomi delle colonne si trovano in pagina quotExecutionsquot di IB Controller. Per esempio quotAvg. pricequot dà prezzo medio di acquisto di dato sicurezza, quotFilledquot dà il numero di sharescontracts riempito GetExecList (di nuovo in 1.3.0) Restituisce elenco separato da virgole di ordini da parametri Lista esecuzioni (Numero di tipo stringa di filtro.): Tipo - specifica cosa dovrebbe essere restituito 0 - dà OrderIDs (attualmente questo è il valore solo accettato) Filtro - quando non svuotarlo dice IBC che solo ordini con lo stato specificato devono essere restituiti a vuoto - tutti gli ordini di attesa lista vengono restituiti. simboli ibc. GetPendingList (0. Riempito) - restituisce virgole elenco di simboli completamente riempiti ID degli ordini separati ibc. GetPendingList (0.) - l'elenco di tutti gli restituisce OrderIDs presenti nelle quotexecutions listquot Per estrarre i simboli dalla lista utilizzare questo tipo di ciclo: per (i 0 (simbolo StrExtract (simboli, i)), i), printf (simbolo: il simbolo n) execlist ibc. GetExecList (0) lista tutti gli ordini di esecuzioni pagina execinfo per (i 0 (OID StrExtract (execlist, i)) i) execinfo execinfo OID Simbolo: ibc. GetExecInfo (OID, Simbolo) riempite: ibc. GetExecInfo (OID, riempito) Avg. prezzo: (. OID, Media prezzo) ibc. GetExecInfo n Questa funzione restituisce il testo dell'ultimo errore stringa del messaggio che rappresenta il messaggio di errore. Vuoto nel caso in cui non vi era alcun messaggio di errore o non esiste OrderId fine - specifica l'ID per poter interrogare ultime informazioni di errore da. C'è un valore speciale che è possibile passare: 0 (zero) e ha un significato speciale: recupera ultimo messaggio di errore per ogni ordine. Questo è esattamente il messaggio che appare in cima alla lista degli errori nell'interfaccia utente IBController. GetStatus (stringa OrderId. Booleano opzionale InclFilled) Questa funzione recupera lo stato di ordine pendente. stringa che descrive lo stato, può essere: quotNotYetTransmittedquot, quotPreSubmittedquot, quotPendingquot, quotCancelledquot, quotSubmittedquot, quotFilledquot, quotErrorquot (nuovo nella 1.0.2), quotInactivequot o vuoto quando l'ordine di corrispondenza non è stata trovata seconda del campo InclFilled alcuni stati sono intermittient. Se InclFilled non è specificato o uguale a false (zero) allora solo stati quotNotYetTransmittedquot, quotPendingquot, quotPreSubmittedquot, quotSubmittedquot sono segnalati in modo coerente. quotCancelledquot e quotFilledquot stati sono intermittient perché tali ordini vengono rimossi dalla lista ordini in corso entro un secondo dal cancellingfilling l'ordine (questo cambierà in futuro). Stato quotErrorquot significa che c'è stato un errore durante l'elaborazione ultima richiesta di placemodify un ordine e si può interrogare informazioni dettagliate sull'errore usando la funzione GetLastError. Se InclFilled è impostato su True poi Status dell'attività anche di sono riportati gli ordini inclusi nell'elenco quotExecutionsquot e questo significa che è possibile ottenere quotCancelledquot, quotFilledquot, quotErrorquot, quotInactivequot coerente. Nota: parametro InclFilled è stato introdotto in 1.0.8. Parametri: OrderId - stringa che specifica il orderID da modificare (restituiti da precedenti PlaceOrder o chiamata ModifyOrder). GetPositionInfo (string Ticker. Stringa Field) Questa funzione recupera il valore del campo di simbolo ticker tenuto attualmente in portafoglio importante cambiamento 1.1.0. La funzione non segnalare le posizioni con zero dimensioni più il valore numerico del campo richiesto per Ticker. Null se nessun campo o no tale posizione disponibili Parametri: Ticker - stringa che specifica il simbolo di securitycontract. Il simbolo deve seguire la simbologia definita in dettaglio: amibrokerib. html campo - uno dei nomi delle colonne si trovano in pagina quotPortfolioquot di IB Controller. Per esempio quotAvg. costquot dà costo medio di acquisto di dato sicurezza, quotUnrealized PNLquot dà profitti non realizzati e perdite. Questa funzione recupera il numero di sharescontracts di simbolo Ticker detenuti attualmente in portafoglio il numero che descibes la taglia della posizione attualmente detenuta per Ticker. I numeri positivi indicano posizione long, numeri negativi significano posizione corta, zero significa che, dato ticker non è tenuto nei Parametri di portafoglio: Ticker - stringa che specifica il simbolo di securitycontract. Il simbolo deve seguire la simbologia definita in dettaglio: amibrokerib. html IsConnected () Questa funzione recupera lo stato della connessione di TWS. 0 - NO Collegamento 1 - Collegamento in corso 2 - mezzi di collegamento OK, nessun messaggio 3 - collegamento OK, ma TWS generato alcuni messaggi WarningError (vedi scheda quotMessages) IsOrderPending (stringa OrderId) Questa funzione controlla se dato ordine è in sospeso (o non ancora trasmessa). Vero - se l'ordine è ancora nella lista in attesa, False se l'ordine è stato riempito, annullata o non esiste ordine a tutti i parametri: OrderId - stringa che specifica il orderID da modificare (restituito dal precedente PlaceOrder o chiamata ModifyOrder). Restituisce separato da virgole lista simbolo delle posizioni attualmente aperte. Importante cambiamento 1.1.0. La funzione non segnalare le posizioni con zero dimensioni più elenco delle posizioni aperte e le loro dimensioni IBC GetTradingInterface (IB) per (i 0 (simbolo StrExtract (openpos, i)), i), printf (posizione I tSymbol: simbolo tsize: ibc. GetPositionSize ( simbolo) n) Restituisce virgole elenco degli ordini separato dal attesa lista Parametri: Tipo - specifica cosa dovrebbe essere restituito 0 - dà OrderIDs, 1 dà simbolo elenca Filtro - quando non svuotarlo dice IBC che solo ordini con lo stato specificato devono essere restituite quando è vuoto - tutti gli ordini di attesa lista vengono restituiti. simboli ibc. GetPendingList (0. Pending) - restituisce elenco separato da virgole di ID degli ordini in sospeso simboli ibc. GetPendingList (1. In attesa) - restituisce virgole elenco di simboli che sono in attesa di ordini simboli ibc. GetPendingList separati (0. errore) - elenco restituisce di OrderIDs che presentano errori simboli ibc. GetPendingList (0. annullato) - restituisce annullati OrderIDs (si prega di tenere a mente questo ordine annullato vengono rimossi automaticamente dalla lista dopo pochi secondi) simboli ibc. GetPendingList (0.) - l'elenco di tutti gli restituisce OrderIDs presente nel listquot quotpending (può essere pendingerrorcancelledpartially filledsubmitted, ecc) per estrarre i simboli dall'uso lista di questo tipo di ciclo: for (i 0 (simbolo StrExtract (simboli, i)), i), printf (simbolo: il simbolo n) CloseAllOpenPositions (opzionale stringa Ticker) (nuova in 1.0.8) invia ordini per chiudere tutte le posizioni attualmente aperte. invia ordine di mercato SELLBUY per ciascuno e per ogni posizione LONGSHORT nella pagina di portafoglio - dovrebbe effettivamente chiudere tutte le posizioni aperte (a condizione che gli ordini di chiusura riempiranno correttamente), nota, tuttavia, che può accadere che questi ordini di chiusura possono fallire (ad esempio quando i mercati sono chiusi ) Nuovo in 1.1.0: ora funzione accetta parametro opzionale. Quando è disponibile, la funzione chiude posizioni solo su ticker specificato. Se non è specificato - opera come precedentemente (chiude posizioni su tutti i simboli). CancelAllPendingOrders (stringa opzionale Ticker) (nuova in 1.0.8) Cancella tutti gli ordini pendenti mandate annullare per ciascuno e per ogni ordine visualizzato nella pagina degli ordini in attesa (con l'eccezione degli ordini con errori) Nuovo in 1.1.0: ora funzione accetta parametro opzionale . Quando è prevista, la funzione cancella gli ordini solo di ticker specificato. Se non è specificato - opera come precedentemente (annulla tutti gli ordini pendenti su tutti i simboli). Trasmettere (OrderID stringa) (nuova in 1.0.8) modifica trasmettere bandiera sul Paramters ordine NotYetTransmitted: OrderID - stringa che specifica il orderid restituito da PlaceOrder restituisce diverso da zero (true) quando orderid è stato trovato nella lista di ordine in sospeso e zero altrimenti. Esso non necesarily significa che la trasmissione ha avuto successo. Transmit (OrderID) viene utilizzato per trasmettere ordini precedentemente effettuati con la bandiera di trasmissione impostato su false. Trasmettere internamente è gestita chiamando la funzione orderquot quotmodify (quindi non avete bisogno di specificare di nuovo gli stessi parametri) ma nota che TWS ha problemi con la gestione di modificare le richieste provenienti troppo in fretta, in modo da non essere in grado di chiamare modifytransmit immediatelly dopo avere ordinato con trasmissione falsa. In questi casi si consiglia di utilizzare attivazione manuale che è abbastanza lento da non causare problemi. Esempio: ibc. Transmit (OrderID) Questa è la funzione SPERIMENTALE. Sospende l'esecuzione per numero specificato di millisecondi. Si prega di non utilizzare questa funzione se non si ha realmente. perché non si blocca sia IBController e AmiBroker per il periodo di tempo specificato e entrambe le applicazioni solito rispondere alle azioni dell'utente (ad esempio ingresso mousekeyboard). Se si sospende l'esecuzione per più di pochi secondi AmiBroker si lamentano server OLE non risponde. Esempio: ibc. Sleep (1000) dormire per 1000 millisecondi 1 secondo Cancella elenco di visualizzazione specificato. dove ListNo può essere: 0 - in attesa di lista di ordine 1 - esecuzione lista 2 - Lista portafoglio 3 - conto lista informazioni 4 - Errore elenco messaggi -1 - significato speciale (di nuovo in 1.3.5) - elenca Cancella tutto ibc. ClearList (4) cancella l'elenco messaggio di errore Nota che questa funzione riguarda solo il display, non influisce sullo stato degli ordini. Quindi, se avete ordini attivi il ordersquot quotpending, elenchi quotexecutionsquot saranno nuovamente riempita di ordini attualmente attivi durante il prossimo aggiornamento di stato (di solito entro frazione di secondo - in modo che non può essere visivamente evidente) Si applica anche per il portafoglio e conto liste di informazione - saranno nuovamente riempite con l'aggiornamento seguente conto - di solito entro pochi secondi. SetAccount (Account stringa) (nuovo in 1.1.0, cambiato nel 1.3.5) IMPORTANTE: Funzionalità di questa funzione è cambiato in 1.3.5 SOLO PER FA (advisor finanziario) i conti. Imposta account attivo per il prossimo PlaceOrder () ModifyOrder () chiama. Si noti che è anche possibile ora per specificare l'account di destinazione direttamente tramite parametro passato a PlaceOrderModifyOrder invece di basarsi su SetAccount (). SetAccount () fa le liste non è chiaro più e non cambia la visualizzazione di conto come ha fatto in pre-1.3.5 versioni. Cancellazione di esecuzione e in attesa di lista è stato problematico, perché quando la commutazione dei conti le informazioni relative agli ordini precedentemente inviati a causa diversa è stata persa sui conti FampF. Così SetAccount () fa liste non chiare automaticamente. Se si vuole fare questo, è possibile chiamare ClearList (-1) esplicitamente. Anche questa funzione non modifica l'account che viene visualizzato nelle schede delle finestre informationquot e quotportfolioquot quotaccount. Per cambiare account visualizzato nella pagina informationquot e quotportfolioquot schede quotaccount utilizzare nuova funzione SetInfoAccount (). Separazione dei conti d'ordine e di visualizzazione permette di dirigere l'ordine di qualsiasi account withing modificare le viste, cioè è possibile MonitorView conto quotAllquot - che visualizza le informazioni cumulativo per tutti gli account FampFFA o qualsiasi altro account mentre ordini per altri account. Per impostazione predefinita, le informazioni di visualizzazione è l'account quotALLquot e nella maggior parte dei casi non c'è bisogno di cambiare come si riceve gli aggiornamenti da tutti i sub-account. SetInfoAccount (Account stringa) (nuova in 1.3.5) Questa funzione cambia l'account che viene visualizzato nelle schede delle finestre e quotportfolioquot quotaccount informationquot. Non cambia account utilizzato per gli ordini. Separazione dei conti d'ordine e di visualizzazione permette di dirigere l'ordine di qualsiasi account withing modificare le viste, cioè è possibile MonitorView conto quotAllquot - che visualizza le informazioni cumulativo per tutti gli account FampFFA o qualsiasi altro account mentre ordini per altri account. Per impostazione predefinita, le informazioni di visualizzazione è l'account quotALLquot e nella maggior parte dei casi non c'è bisogno di cambiare come si riceve gli aggiornamenti da tutti i sub-account. Si noti che IB utilizza quotAquot pedice per designare conto quotAllquot che è aggregato di tutti i sottoconti. Quindi, se il tuo account FA ha un certo numero di F1234, è necessario aggiungere il suffisso quotAquot ad essa per ottenere dati aggregati: Chiude il collegamento a TWS e ri-apre, cancella tutte le liste e requeries per gli ordini in sospeso. In sostanza dà lo stesso effetto che si potrebbe ottenere da terminare e ri-esecuzione IB Controller. 1. L'immissione e la trasmissione di mercato Buy ordine per 100 azioni quando MACD attraversa sopra la linea di segnale: Comprare Cross (MACD (), Signal ()) se (LastValue (Buy)) ibc GetTradingInterface (IB) controllare se siamo connessi OK se (IBC. IsConnected ()) verificare se non abbiamo posizione già aperta su questo stock se (ibc. GetPositionSize (Nome ()) 0) trasmettere ordine ibc. PlaceOrder (Nome (), Buy. 100. MKT. 0. 0. Giorno . true) 2. Placingmodifying un ordine di limite sul prezzo corrente più 0,10 ma senza trasmetterla (trasmissione manuale richiesto). Questo codice può essere eseguito tante volte e modificherà ordine esistente finché non viene trasmessa. Esso utilizza variabili statiche per memorizzare orderId da ultimo run. Comprare L gt Ref (H -. 1) acquistare quando i prezzi gap up if (LastValue (Buy)) ibc GetTradingInterface (IB) controllare se siamo connessi OK se (ibc. IsConnected ()) gli ordini di posto solo se non abbiamo già posizione aperta su questo simbolo, se (ibc. GetPositionSize (Nome ()) 0) recuperare orderID dalla precedente esecuzione, sarà vuoto se non ordine è stato effettuato prima OrderID StaticVarGetText (OrderID Nome ()) posto o modificare l'ordine - non trasmettere ancora IDOrdine ibc. ModifyOrder (OrderID, Nome (), acquistare. 100. LMT. LastValue (C) 0.10. 0. Day. Falso) negozio orderID per la prossima corsa così sappiamo che per poter modificare StaticVarSetText (OrderID Nome (), OrderID) 3 . Placingmodifying manualmente dalla finestra di dialogo Parametri. Codice da applicare in Indicator Builder. (Modificato per utilizzare nuove funzioni 1.0.2) Questo codice può essere eseguito tante volte e modificherà ordine esistente finché non viene trasmessa. Esso utilizza variabili statiche per memorizzare orderId da ultimo run. Blocco Param TriggerOrder ParamTrigger (ordine del posto. Clicca qui per ordinare) Modalità ParamToggle (Mode. Modifica existingAlways posto nuovo ordine) ACT paramlist (azione. BUYSELLSSHORT) OT paramlist (Tipo ordine. MKTLMTSTP) TIF paramlist (ora in vigore. DAYGTCIOC) Ticker ParamStr (. Ticker Nome ()) NumShares Param (Numero di azioni 10. 10. 100. 10.) LimitPrice LastValue (C) (Offset limite di prezzo 0,. - 0,1 0,1 0,01..) Param StopPrice LastValue (C) Param ( prezzo di smettere di offset 0, -... 0.1 0.1 0.01) trasmissione ParamToggle (Transmit fare NON transmitTransmit 0) TriggerCancel ParamTrigger (Annulla ordine Clicca qui per cancellare ordine) Msg questa negozi messaggio di errore testo variabile creare un'istanza di commercio di interfaccia IBC GetTradingInterface... (IB) recuperare orderID dalla precedente esecuzione, sarà vuoto se non ordine è stato effettuato prima OrderID StaticVarGetText (OrderID Ticker) se (TriggerOrder) controllare se siamo connessi OK se (ibc. IsConnected ()) se (modalità 1) se la modalità IDOrdine settati sempre nuova, allora chiare posto orderid ordini soltanto se non abbiamo posizione già aperta su questo luogo simbolo o modificare l'ordine - non trasmettere ancora OrderID ibc. ModifyOrder (OrderID, Ticker, ACT, NumShares, OT, LimitPrice, StopPrice, TIF , Transmit) negozio orderID per la prossima corsa quindi sappiamo che per poter modificare StaticVarSetText (OrderID Ticker, IDOrdine) se (modalità 1) Msg nuovo ordine è stato collocato con ID altro Msg Ordinare placedmodified con ID Msg Msg IDOrdine su Now () altro Msg di ordinare riuscita a causa di alcuna connessione con TWS se (TriggerCancel) se (OrderId) se (ibc. CancelOrder (OrderId)) Msg richiesta di annullamento dell'ordine OrderId inviato con successo altro Msg richiesta di annullamento dell'ordine IDOrdine fallito. altro Msg non può annullare ordine becase OrderID è execlist vuoto ibc. GetExecList (0) tutti execinfo per (i 0 (OID StrExtract (execlist, i)), i) execinfo execinfo OID Simbolo: ibc. GetExecInfo (OID, Simbolo) riempite: ibc. GetExecInfo (OID, riempito) Avg. prezzo: ibc. GetExecInfo n codice di monitoraggio Titolo messaggio Msg Nlast TWS (OID, Media prezzo.): ibc. GetLastError (0) fondi nDisponibile: ibc. GetAccountValue (AvailableFunds) Gross Pos. Value: ibc. GetAccountValue( GrossPositionValue ) nOrderID OrderId nTicker Ticker nAction ACT nShares NumToStr (NumShares, 1.0 ) nOrderType OT nLimitPrice NumToStr (LimitPrice, 1.3 ) nStopPrice NumToStr (StopPrice, 1.3 ) nTimeInForce TIF nTransmit NumToStr (Transmit, 1.0 ) n nGetStatus ibc. GetStatus( OrderID ) nGetPositionSize ibc. GetPositionSize( Ticker ) nIsConnected NumToStr (ibc. IsConnected(), 1.0 ) nExecInfon execinfo 4. Placing bracket order create instance of trading interface ibc GetTradingInterface ( IB ) parentID ibc. PlaceOrder( MSFT. BUY. 1000. LMT. 27. 0. GTC. False ) ibc. PlaceOrder( MSFT. SELL. 1000. LMT. 28. 0. GTC. False . 100. . parentID ) ibc. PlaceOrder( MSFT. SELL. 1000. STP. 26. 26. GTC. True . 100. . parentID ) Note that TRANSMIT flag is set to FALSE on all bracket orders except the last one. This ensures that orders wait until bracket order set is completed. Setting Transmit flag to TRUE on the very last one transmits entire bracket. 5. Iterating through open positions: ibc GetTradingInterface ( IB ) for ( i 0 ( symbol StrExtract ( openpos, i ) ) i ) printf ( Position i tSymbol: symbol tSize: ibc. GetPositionSize( symbol ) n ) 6. Placing OCA group orders: ibc. PlaceOrder( MSFT. SELL. 1000. LMT. 28. 0. GTC. True . 100. . 0. MYGROUP ) ibc. PlaceOrder( MSFT. SELL. 1000. STP. 26. 26. GTC. True . 100. . 0. MYGROUP ) 1) Why IBController has BETA status The reason is simple - because it relies on IB API we have no control upon. You need to be aware of the fact that Interactive Brokers may and actually do change TWS and API quite often and any future changes in the APITWS may produce incompatiblities without any warning. We try to adjust IBController as soon as such incompatibilities surface, but we can only do that quotafter the factquot. Due to this there can be periods when IBController does not work properly with certain version(s) of TWS. That is the only reason why IBController is marked as BETA. 2) What exactly is the OrderID, where is the number stored How does it increment Can we assign our own OrderIDs OrderID is a string that represents the unique order number that is assigned by IB Controller (for orders placed via IB Controller) or TWS (for orders placed in TWS) when you place the order. It is automatically incremented on each NEW order. The implementation takes care that generated ID is unique for given session of TWS. You should NOT assign your own IDs because you may risk generating duplicates that will be rejected by TWS. 3) The IB Interface contains a lot of useful information, can we access this information in afl GetAccountValue() function (introduced in 1.0.2) allows that. 4) IMPORTANT. During development i often quotlosequot my connection to the TWS and cannot get it going again. Under what conditions candoes this happen This is probably caused by placing ModifyOrder calls too often so TWS is not able handle them and sends error messages (quotUnable to modify this order as its still being processedquot) and it results in IsConnected() returning false. This should be addressed by next version. If such thing happens you can simply close IB Controller window. 5) Is it possible to read IB LastBifAsk prices while running a eSignal database Right now there is no access to price data via IBController but maybe in the future 6) Why do we have a PlaceOrder() and a ModifyOrder(), if ModifyOrder can be used in both cases Just for completeness. Indeed ModifyOrder alone would be enough. 7) Can we retrieve the quotExecutionsquot and quotPendingquot page (string) from the IB Controller window, for display on the chart Pending - yes you can retrieve the status of the order while it is on quotPendingquot page using GetStatus. As for quotexecutionquot tab - as it is already described in the read me this is in the works. 8) It appears the startup sequence of TWS and AB is significant, is it Not actually TWS and AB - they are independent. But what is important to run TWS before running IB Controller. If you however have your trading code in indicator then it may be auto-refreshed at AB start and in this individual case you would need to run TWS before AB. Anyway if something fails you can simply close IB controller window and it will re-open automatically and reconnect on next call to GetTradingInterface. 9) When the TWSAB connection is broken during trading, what is the best way to restore it Close IB Controller manually. It will re-open automatically and reconnect on next call to GetTradingInterface. 10) What is the consequence of repeated PlaceOrder() or ModifyOrder() execution due to AB Refresh What happens when, instead of using Cross() with use quotgtquot or quotltquot Franly auto-trading interface is NOT indented to be used in indicators. It is intended to be used in AA window. But if you prefer to run it in IB you can do this too, but then you should check pending orders and check portfolio position size for given symbol not to buy too many shares. To answer your question: multiple PlaceOrder calls will result in multiple orders placed. Multiple ModifyOrder() calls may result in the same (if OrderID is empty) or may just result in updating the values of already exisiting, pending order if you specify correct OrderID of order placed before (see the example 2.) 11 ) A quotclearquot Message button would be nice in the IBc window, i have to scroll down continuously to see the latest message (perhaps last-on-top scrolling) It is already available in version 1.0.2 12) What is the best way to write a single-(user initiated)-execution line of code. this is where the ParamTask() i suggested earlier would come in handy. Use new AFL ParamTrigger function ParamTrigger( quotNamequot, quotButton textquot) - to be used in indicator builder - to create triggers (buttons). If you place ParamTrigger in the indicator code it will create a quotbuttonquot in Parameter dialog that can be pressed. Normally ParamTrigger will return zero (0) but when button in the param window is pressed then it will refresh the chart and ParamTrigger will return 1 (one) for this single execution (further refreshes will return zero, until the button is pressed again) trigger ParamTrigger ( Place Order. Click here to place order ) if ( trigger ) your one-shot code here 13) When placing orders from an indicator (the thing to do in RT trading) and editing the code will result in additional afl executions, how can i prevent randon order placement from the extra passes Parameters and Signals may not be the same as a result of using loops, DLLs, and things. Use static variables as given in example 2 to MODIFY existing order instead of placing many new orders. Or use code given in response to question 10 14) I got an warning from TWS that is treated as error in Pending list. How can I solve that You can put specific TWS code onto quotIgnore listquot (use File-gtError code ignore list to enter codes in comma separated list). Any code entered here will be ignored by Pending List page, but still will be displayed in the messages window. 15) some message in the IBc are not clearprecise in their meaning. Well these messages come from TWS and I have no influence on their wording :-) CHANGES FOR VERSION 1.3.8 removed the workaround introduced in 1.3.5 for symbol translation because it caused problems for symbols like 6EU0-GLOBEX-FUT where symbol is not equal to local symbol less expiration code (EUR vs 6E). Instead symbol translation now relies solely on method introduced in 1.3.6 CHANGES FOR VERSION 1.3.7 GetPositionList() returned empty symbol part for non-stocks. Fixed PlaceOrder failed on Financial advisor accounts when non-master Account was passed in a parameter without preceding SetAccount call. Fixed. CHANGES FOR VERSION 1.3.6 IBController now uses more reliable way to translate from local symbol to TWS symbolexpiry pair based on information sent back by TWS. (It is not as simple as one may think because sometimes local symbol does not contain TWS symbol, so one can not derive TWS symbol from local symbol in general case, for example FESX SEP 10 local symbol translates to ESTX50,20100917, therefore IBController needs to get info from TWS) CHANGES FOR VERSION 1.3.5 New SetInfoAccount( account ) This function changes the account which is displayed in the quotaccount informationquot window and quotportfolioquot tabs. It does NOT change account used for orders. Separation of order and viewing accounts allows directing orders to any account withing changing any views, i. e. you can monitorview quotAllquot account - that displays cumulative information for all FampFFA accounts or any other account while placing orders for other accounts. By default viewing information is the quotALLquot account and in most cases there is no need to change it as it receives updates from all sub-accounts. To workaround recent change in TWS, for futures (FUT) symbol field is set by IBController as localsymbol without expiration monthyear. This is temporary workaround which may be broken by other TWS releases. Tested to work with TWS 907.7Pending OrdersExecutionsPortfolioAccount info tabs now have additional command quotAccountquot that specifies the account given item refers toPlaceOrder and ModifyOrder now accept optional Account parameterThis allows to specify destination account for order for FampFFA IB accounts in single call, instead of relying on SetAccountPlaceOrder sequence. Single-call PlaceOrderModifyOrder with account specification allows to specify account without worrying that other threadsprocesses can switch the account between SetAccount() and PlaceOrder(). Now SetAccount() only sets account for NEXT order(s). It does NOT clear lists anymore and does NOT change viewing accountClearing execution and pending list was problematic because when switching accounts the information about previously sent orders on different account was lost on FampF accounts. So SetAccount() does not clear lists automatically. If you want to do this, you can call ClearList( -1 ) explicitely. Also this function does NOT change the account which is displayed in the quotaccount informationquot window and quotportfolioquot tabs. To change account displayed in the quotaccount informationquot page and quotportfolioquot tabs use new function SetInfoAccount(). Separation of order and viewing accounts allows directing orders to any account withing changing any views, i. e. you can monitorview quotAllquot account - that displays cumulative information for all FampFFA accounts or any other account while placing orders for other accounts. By default viewing information is the quotALLquot account and in most cases there is no need to change it as it receives updates from all sub-accounts. ClearList() method accepts -1 as listno - then it clears ALL lists CHANGES FOR VERSION 1.3.2 fixed compatibility issues with TWS version 904 CHANGES FOR VERSION 1.3.1 added configuration file to support AmiBroker 5.30 trading from chart functionality CHANGES FOR VERSION 1.3.0 added GetExecList and GetExecInfo functions. CHANGES FOR VERSION 1.2.1 The IBc now accepts new symbology convention with 4th part defining currency: SYMBOL-EXCHANGE-TYPE-CURRENCY. When currency is not specified USD is used as default. For more info see amibrokerib. html The IBc also accepts single letter type codes CHANGES FOR VERSION 1.2.0 IBc now allows to define which error codes should be ignored using File-gtError code ignore list upgraded to use latest TWS API 9.41 (tested with latest TWS 885.7, requires at least 879) following TWS API changes ignoreRth and rthOnly flags are removed and replaced with single flag: outsideRTH Quote from TWS DOC interactivebrokersensoftwareapiReleaseNotesapi94.phpibentityllc quotOutsideRTH Flag Replaces quotIgnore Regular Trading Hoursquot and quotRegular Trading Hours Onlyquot Flags Supported in: All API Platforms A new, single order atttibute, bool OutsideRTH(), replaces two flags: ignoreRTH and rthOnly in the Order classstruct. If set to true, this new extended order attribute allows orders to trigger or fill outside of regular trading hours. quot CHANGES FOR VERSION 1.1.1 primaryExchange is now set to empty. This solves quotinvalid symbolquot problem occuring for some accounts during last 2 weeks following apparent changes in IB. CHANGES FOR VERSION 1.1.0 Added handling of error codes 2100, 1100, 1101, 1102, 1300 Financial advisor Account support (FC Issue 69) : Added FA-only fields to PlaceOrderModifyOrder When run on FA account IBc automatically queries for account list and uses quotAllquot account by defaultGetAccountValue now allows to query values separately for each currency. Currency specific values are available using this syntax: CURFieldName where CUR is currency symbol for example: USDAvailableFunds EURAvailableFundsWhen currency is NOT specified IBc first looks for values specified in BASE currency and if not found then uses USD as default, so you can use old-style GetAccountValue(quotAvailableFundsquot) and it will return the same as GetAccountValue(quotUSDAvailableFundsquot) - because there available funds are not specified in base currency. If you however call GetAccountValue(quotTotalCashBalancequot) it will report in BASE currency and it may be different from GetAccountValue(quotUSDTotalCashBalancequot) which will represent USD cash only. Differences will occur if you have cash positions in many currencies so quotbasequot currency shows gross total of all positions in all currencies as if they were exchanged into base currency. added limit of error messages to be displayed (File-gtConfigure)added re-querying for positions after reconnectan option to restartreconnect (File-gtReconnect), new method Reconnect()CancelAllPendingOrders( optional Ticker ) now CancelAllPendingOrders method takes optional parameter Ticker. If it is specified - it cancels orders only for specified symbol. If it is NOT specified - it cancels all orders for ALL symbols. ClearList( iListNo ) method added ClearList( ListNo ) where ListNo can be: 0 - pending order list 1 - execution list 2 - portfolio list 3 - account information list 4 - error message listibc. ClearList( 4 ) clears error message list Note that this function only affects the display, it does NOT affect the status of orders. So if you have any active orders the quotpending ordersquot, quotexecutionsquot lists will be re-filled with currently active orders during next status update (usually within fraction of second - so it may not be visually noticeable) It also applies for portfolio and account information lists - they will be re-filled with next account update - usually within few seconds. CloseAllOpenPositions( optional Ticker ) now CloseAllOpenPosition method takes optional parameter Ticker. If it is specified - it closes positions only for specified symbol. If it is NOT specified - it closes all positions. exchange is reported correctly for non-US stocks in Portfolio pageGetPositionList() - returns only symbols with positions ltgt 0OCA groups support added to PlaceOrderModifyOrderuser-definable port and IP number (File-gtConfigure)SetAccount( AccNo ) - for FA accountsWarning 2107 (Historical Market Data Service inactive) and 2104 (market data OK) is silently ignored now CHANGES FOR VERSION 1.0.8 GetStatus() function now has optional parameter InclFilled GetStatus( string OrderId, optional boolean InclFilled ) when InclFilled is provided and set to true GetStatus function provides statuses for filled, cancelled and error orders that may have been already deleted from pending list. TimeInForce field in PlaceOrderModifyOrder allows now to specify quotGood Till Datequot and quotGood After Timequot datetimes)TimeInForce field in PlaceOrderModifyOrder accepts GTD and GAT specifications GTD - Good Till Date - indicates that the order should remain workign untilthe time and date set. Good Till Date specification GTD YYYYMMDD HH:MM:SS TZONE where: YYYY is 4 digit year, MM is 2 digit month, DD is 2 digit day, HH is 2 digit hour, MM is 2 digit minute, SS is 2 digit second (OPTIONAL), TZONE is time zone (OPTIONAL) After regular TimeInForce specifications (DAY, GTC, GTD) you may add extraGoodAfterTime (GAT) part. GAT part comes AFTER semicolon. It indicates thattrade should be submitted after the time and date set: GAT specifications: DAYGAT YYYYMMDD HH:MM:SS TZONE - day order valid after specified datetime GTCGAT YYYYMMDD HH:MM:SS TZONE - good till canceled order valid after specified time GTD yyyymmdd hh:mm:ss tzoneGAT YYYYYMMDD HH:MM:SS TZONE - GTD order valid after specified time where: YYYY is 4 digit year, MM is 2 digit month, DD is 2 digit day, HH is 2 digit hour, MM is 2 digit minute, SS is 2 digit second (OPTIONAL), TZONE is time zone (OPTIONAL) Note: there must be NO SPACE characted between semicolon and GAT string. ibc. PlaceOrder( MSFT. BUY. 100. LMT. 27. 0. DAYGAT 20051214 18:00:00 GMT. True ) - day limit order good after Dec 14,2005, 18:00 GMT ibc. PlaceOrder( MSFT. BUY. 100. LMT. 27. 0. GTD 20051215 17:00:00 GMTGAT 20051214 18:00:00 GMT. True ) - limit order valid from Dec 14,2005 18:00 to Dec 15,2005 17:00 GMT ibc. PlaceOrder( MSFT. BUY. 100. LMT. 27. 0. GTD 20051215 19:00:00 GMT. True ) - limit order valid from now until Dec 15,2005 19:00 GMT Portfolio page should now display correct exchange for futures (now it uses reqContractDetails to query for exchange string that is not sent via accountUpdates by TWS) new Transmit( orderID ) method Transmit( string orderid )- returns non-zero (true) when orderid has been found on the pending order listand zero otherwise. It does not necesarily mean that transmit was successful. Transmit( orderid) is used to transmit orders previously placed with transmit flag set to false. Transmit internally is handled by calling quotmodify orderquot function (so you dont need to specify the same parameters again) but note that TWS has problems with handling modify requests coming too quickly, so you will NOT be able to call modifytransmit immediatelly after placing order with transmit false. In such cases we recommend using manual trigger that is slow enough not to cause problems. GetPositionList() method added - returns comma separated list of currently open positionslist of open positions and their sizes ibc GetTradingInterface ( IB ) for ( i 0 ( symbol StrExtract ( openpos, i ) ) i ) printf ( Position i tSymbol: symbol tSize: ibc. GetPositionSize( symbol ) n ) GetPendingList( Type, Filter ) - retrieves comma-separated list of orders from pending listwhere: Type - specifies what should be returned 0 - gives ORDERIDs, 1 gives symbol lists Filter - when not empty it tells IBc that only orders with specified status should be returned when empty - all orders from pending list are returned. symbols ibc. GetPendingList( 0. Pending ) - returns comma separated list of pending order IDs symbols ibc. GetPendingList( 1. Pending ) - returns comma separated list of SYMBOLS that have pending orders symbols ibc. GetPendingList( 0. Error ) - returns list of orderids that have errors symbols ibc. GetPendingList( 0. Cancelled ) - returns cancelled orderids (please keep in mind that cancelled order are automatically removed from the list after few seconds) symbols ibc. GetPendingList( 0. ) - returns list of all orderIDs present in the quotpending listquot (may be pendingerrorcancelledpartially filledsubmitted, etc) added experimental Sleep() methodSleep( number Milliseconds ) - suspends the execution for specified number of milliseconds. Please do NOT use this function unless you really have to, because it locksboth IBController and AmiBroker for specified period of time and both applicationswont respond to user actions (such as mousekeyboard input). If you suspendexecution for more than few seconds AmiBroker will complain about OLE server not responding. added CloseAllOpenPositons(), CancelAllPendingOrders methods and Panic buttonCloseAllOpenPositions() method - sends MARKET SELLBUY order for each and every LONGSHORT position in the portfolio page - should effectively close all open positions (provided that closing orders will fill correctly), note however that it may happen that these closing orders may fail (for example when markets are closed) CancelAllPendingOrders - sends cancel for each and every order displayed in the Pending orders page (with the exception of orders with Errors) Panic button in the toolbar - sends CancelAllPendingOrders() and then CloseAllOpenPositions() Bracket orders support. PlaceOrder and ModifyOrder methods have two additional optional parameters: Attributes and ParentIDPlaceOrder( string Ticker, string Action, number Quantity, string Type, number LimitPrice, number StopPrice, string TimeInForce, bool Transmit, optional number TickSize 100, optional string Attributes quotquot, optional string ParentID quotquot Attributes - is a string that allows to specify additional order attributes (comma separated list). Supported attributes: rthOnly - (OBSOLETE NOW in 1.2.0) if specified means that the order will only be filled during RTH this applies to any order type including limit. ignoreRth - (OBSOLETE NOW in 1.2.0) if specified means that order will trigger not only during Regular Trading Hours (RTH), but also in extended trading (preafter market) this applies to stop orders, conditional orders, and alerts it is used by the triggering logic. If not specified (false) orders will trigger ONLY during RTH. allOrNone - fill all or nothing at all eTradeOnly - trade with electronic quotes only firmQuoteOnly - trade with firm quotes only By default all those flags are INACTIVE (OFF) Example: ibc. PlaceOrder( MSFT. BUY. 1000. LMT. 27. 0. GTD 20051215 19:00:00 GMT. True . 100. allOrNone ) (Note that optional parameter TickSize MUST be specified if you want to use Attributes) ParentID - is a string that specifies parent order identifier (returned by previous PlaceOrder call) allowing you to place BRACKET orders. parentID ibc. PlaceOrder( MSFT. BUY. 1000. LMT. 27. 0. GTC. False ) ibc. PlaceOrder( MSFT. SELL. 1000. LMT. 28. 0. GTC. False . 100. . parentID ) ibc. PlaceOrder( MSFT. SELL. 1000. STP. 0. 26. GTC. True . 100. . parentID ) now IBController does not require API installation CHANGES FOR VERSION 1.0.6 re-compiled with TWS API 8.41 BETA CHANGES FOR VERSION 1.0.5 fixed problem with GetPositionSize() reporting zero for SMART routed symbols in 1.0.4 CHANGES FOR VERSION 1.0.4 fixed symbology used in Order, Status and Porfolio pages so now futures and currencies work nicely added optional TickSize parameter that defines minimum price fluctuation allowed for given symbol (expressed in pips, i. e. 0.0001). For stocks usually 100 (i. e. 0.01), for Forex: 1. automatic reconnect implemented - IBc now attempts to reconnect to IB every 5 seconds when case connection is lost or IB has crashed and was restarted Now works with quotFire OpenOrder on status changequot setting turned off as well as turned on. Order once marked with quotErrorquot status keeps last error message CHANGES FOR VERSION 1.0.3 compiled with TWS API 8.30 added GetPositionInfo method added unlock code dialog (File-gtEnter Unlock code). IBController by default does not transmit orders automatically. Transmission can be enabled by entering unlock code that is made available to the user after accepting the agreement. CHANGES FOR VERSION 1.0.2 IBC: Now pending order list features new status code quoterrorquot and new column: Last error IBC: New toolbar button: auto-cancel orders with errors - when turned on, all orders with errors are cancelled automatically IBC: Error messages now show order id and error code IBC: Repeating messages are now displayed once with appropriate repeat count and last update time IBC: Most recent error messages now appear on the top of the quotmessagequot list, so you dont need to scroll IBC: quotDuplicate order IDquot problem solved Now when TWS sends quotduplicate orderquot message, appropriate order line is marked in IB Controlled as quoterrorquot and such order ID is no longer used. When new ModifyOrder is placed then new order id will be assigned IBC: GetAccountValue function in IB interface CHANGES FOR VERSION 1.0.1 CancelOrder() removes quotNotYetTransmittedquot orders from the pending list IsConnected() funcition now returns integer values 0..3 (not bool) Clear Messages toolbar button added CHANGES FOR VERSION 1.0.0 HOW TO REPORT BUGS If you experience any problem with this beta version please send detailed description of the problem (especially the steps needed to reproduce it) to bugs at amibrokerThe Snake Trading System - Forex Strategies - Forex Resources - Forex Trading-free forex trading signals and FX Forecast 461 The Snake Trading System ALL INDICATORS REPAINT For each indicators, there are a max number of bars within the signal can be repainted, it depends on how many bars the signal is calculated. Se la sua calcolata sugli ultimi 3 bar, il segnale dietro il quarto ridisegno barra di sopraelevazione. Se il signail è calcolato in ultima barra unica, si ridisegna il bar aperto corrente, e si può scambiare il segnale alla chiusura del bar. Impropriamente, theyre chiamato indicatori non riverniciatura. La maggior parte degli indicatori wich dà signails a EA (sistemi di auto-trading, esigenze wich solo segnali chiari) funziona in questo modo, ma questo non è necessariamente il modo migliore per costruire un indicatore per un sistema commerciale discrtetional. In un riverniciatura discrezionale Trading Stystem è un problema troppo. Non puoi avere feeling con scomparsa frecce, linee e punti Fortunatamente, l'occhio umano può filtrare i segnali buoni e cattivi abbastanza facilmente, utilizzando altri indicatori di monitoraggio diversi paramenters. A volte, in un sistema di negoziazione. è meglio lasciare che il sistema di trading vi darà alcuni segnali veloci, oltre ad altro indicatore ritardato, più forte. Share your opinion, can help everyone to understand the forex strategy. Todays Stock Market News amp Analysis Real-Time After Hours Pre-Market News Flash Quote Summary Quote Interactive Charts Default Setting Please note that once you make your selection, it will apply to all future visits to NASDAQ. Se, in qualsiasi momento, si è interessato a ritornare alle nostre impostazioni predefinite, selezionare Impostazioni predefinite sopra. Se avete domande o incontrano problemi nel cambiare le impostazioni predefinite, inviare un'e-mail isfeedbacknasdaq. Si prega di confermare la selezione: Hai scelto di modificare l'impostazione predefinita per il preventivo Cerca. Questo sarà ora la tua pagina di destinazione predefinita a meno che non si cambia di nuovo la configurazione, o si eliminano i cookie. Sei sicuro di voler modificare le impostazioni Abbiamo un favore da chiederti Si prega di disattivare il blocco annuncio (o aggiornare le impostazioni per garantire che JavaScript ei cookie sono abilitati), in modo che possiamo continuare a fornire con le notizie di mercato di prim'ordine ei dati youve si aspettano da noi.

No comments:

Post a Comment