pertukaran adalah objek pertukaran, yang merupakan objek pertukaran pertama yang ditambahkan ke strategi tetapan perdagangan langsung, tetapan backtest, dan semua interaksi dengan pertukaran diwujudkan melalui fungsi anggota objek ini.
objek
function main() {
Log("On the live trading page or backtest page, the first exchange object name added: ", exchange.GetName(), ", label:", exchange.GetLabel())
}
def main():
Log("On the live trading page or backtest page, the first exchange object name added: ", exchange.GetName(), ", label:", exchange.GetLabel())
void main() {
Log("On the live trading page or backtest page, the first exchange object name added: ", exchange.GetName(), ", label:", exchange.GetLabel());
}
{@var/EXCHANGE/exchanges exchanges}, {@fun/Account/exchange.GetName exchange.GetName}, {@fun/Account/exchange.GetLabel exchange.GetLabel}
Bursa adalah pelbagai objek pertukaran, yang mengandungi semua objek pertukaran yang ditambahkan dalam tetapan perdagangan langsung strategi, tetapan backtest, bursa[0], iaitu {@var/EXCHANGE exchange}. Objek pertukaran yang ditambahkan dalam tetapan perdagangan langsung strategi atau tetapan backtest sepadan dengan pertukaran[0], pertukaran[1], pertukaran[2], pertukaran[n]... mengikut urutan yang ditambahkan.
Array
function main() {
for(var i = 0; i < exchanges.length; i++) {
Log("Index of the added exchange object (the first one is 0 and so on):", i, "Name:", exchanges[i].GetName(), "Label:", exchanges[i].GetLabel())
}
}
def main():
for i in range(len(exchanges)):
Log("Index of the added exchange object (the first one is 0 and so on):", i, "Name:", exchanges[i].GetName(), "Label:", exchanges[i].GetLabel())
void main() {
for(int i = 0; i < exchanges.size(); i++) {
Log("Index of the added exchange object (the first one is 0 and so on):", i, "Name:", exchanges[i].GetName(), "Label:", exchanges[i].GetLabel());
}
}
{@var/EXCHANGE exchange}, {@fun/Account/exchange.GetName exchange.GetName}, {@fun/Account/exchange.GetLabel exchange.GetLabel}
ORDER_STATE_PENDING ialah nilaiStatus
atribut dalam struktur {@struct/Order Order}, menunjukkan bahawa status pesanan tidak selesai.
nombor
Nilai ORDER_STATE_PENDING ialah 0.
{@var/ORDER_STATE/ORDER_STATE_CLOSED ORDER_STATE_CLOSED}, {@var/ORDER_STATE/ORDER_STATE_CANCELED ORDER_STATE_CANCELED}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN ORDER_STATE_UNKNOWN}
ORDER_STATE_CLOSED ialah nilaiStatus
atribut dalam struktur {@struct/Order Order}, yang menunjukkan bahawa status pesanan telah selesai.
nombor
Nilai ORDER_STATE_CLOSED ialah 1.
{@var/ORDER_STATE/ORDER_STATE_PENDING ORDER_STATE_PENDING}, {@var/ORDER_STATE/ORDER_STATE_CANCELED ORDER_STATE_CANCELED}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE_UNKNOWN}, {@var/ORDER_STATE_STATE_UNKNOWN}, {@var/ORDER_STATE_STATE_UNKNOWN}, {
ORDER_STATE_CANCELED ialah nilaiStatus
atribut dalam struktur {@struct/Order Order}, menunjukkan bahawa status pesanan dibatalkan.
nombor
Nilai ORDER_STATE_CANCELED ialah 2.
{@var/ORDER_STATE/ORDER_STATE_PENDING ORDER_STATE_PENDING}, {@var/ORDER_STATE/ORDER_STATE_CLOSED ORDER_STATE_CLOSED}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN ORDER_STATE_UNKNOWN}
ORDER_STATE_UNKNOWN ialah nilaiStatus
atribut dalam struktur {@struct/Order Order}, yang menunjukkan bahawa status pesanan tidak diketahui (status lain).
nombor
Nilai ORDER_STATE_UNKNOWN ialah 3.
UntukORDER_STATE_UNKNOWN
status, anda boleh memanggil {@fun/Market/exchange.GetRawJSON exchange.GetRawJSON} fungsi untuk mendapatkan maklumat status pesanan asal, semak penerangan khusus mengikut dokumentasi pertukaran.
{@var/ORDER_STATE/ORDER_STATE_PENDING ORDER_STATE_PENDING}, {@var/ORDER_STATE/ORDER_STATE_CLOSED ORDER_STATE_CLOSED}, {@var/ORDER_STATE/ORDER_STATE_CANCELED ORDER_STATE_CANCELED}
ORDER_TYPE_BUY ialah nilaiType
atribut dalam struktur {@struct/Order Order}, yang menunjukkan jenis pesanan beli.
nombor
Nilai ORDER_TYPE_BUY ialah 0.
{@var/ORDER_TYPE/ORDER_TYPE_SELL ORDER_TYPE_SELL}
ORDER_TYPE_SELL ialah nilaiType
Atribut dalam struktur {@struct/Order Order}, yang menunjukkan jenis pesanan jual.
nombor
Nilai ORDER_TYPE_SELL ialah 1.
{@var/ORDER_TYPE/ORDER_TYPE_BUY ORDER_TYPE_BUY}
PD_LONG ialah nilaiType
atribut dalam struktur {@struct/Position Position}, yang menunjukkan jenis kedudukan panjang.
nombor
Nilai PD_LONG ialah 0.
Untuk kedudukan panjang di pasaran kontrak, gunakan exchange.SetDirection ((
{@var/POSISI_DIRECTION/PD_SHORT PD_SHORT}
PD_SHORT ialah nilaiType
atribut dalam struktur {@struct/Position Position}, yang menunjukkan jenis kedudukan pendek.
nombor
Nilai PD_SHORT ialah 1.
Untuk kedudukan pendek di pasaran kontrak, gunakan exchange.SetDirection ((
{@var/POSISI_DIRECTION/PD_LONG PD_LONG}
ORDER_OFFSET_OPEN ialah nilaiOffset
atribut dalam struktur {@struct/Order Order}, yang menunjukkan bahawa pesanan adalah dalam arah terbuka.
nombor
Nilai ORDER_OFFSET_OPEN ialah 0.
{@var/ORDER_OFFSET/ORDER_OFFSET_CLOSE ORDER_OFFSET_CLOSE}
ORDER_OFFSET_CLOSE ialah nilaiOffset
atribut dalam struktur {@struct/Order Order}, yang menunjukkan bahawa pesanan adalah dalam arah yang hampir.
nombor
Nilai ORDER_OFFSET_CLOSE ialah 1.
{@var/ORDER_OFFSET/ORDER_OFFSET_OPEN ORDER_OFFSET_OPEN}
Menunjukkan konstanta tempoh garis K 1 minit dengan nilai 60.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_H2 PERIOD_H2}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD/PERIOD_M15 PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD
Menunjukkan konstanta tempoh garis K 3 minit dengan nilai 180.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_H2 PERIOD_H2}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD/PERIOD_M15 PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD
Menunjukkan konstanta tempoh garis K 5 minit dengan nilai 300.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_H2 PERIOD_H2}, {@var/PERIOD/PERIOD_M3 PERIOD_H4}, {@var/PERIOD/PERIOD_M15 PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD
Menunjukkan konstanta tempoh K-garis 15 minit dengan nilai 900.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_H2 PERIOD_H2}, {@var/PERIOD/PERIOD_M3 PERIOD_H4}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1}, {@var/PERIOD_H2 PERIOD_H4}, {
Menunjukkan konstanta tempoh garis K 30 minit dengan nilai 1800.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_H2 PERIOD_H2}, {@var/PERIOD/PERIOD_M3 PERIOD_H4}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_M15 PERIOD_H6}, {@var/PERIOD/PERIOD_H1}, {
Menunjukkan konstanta tempoh garis K 1 jam dengan nilai 3600.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H2 PERIOD_H2}, {@var/PERIOD/PERIOD_M3 PERIOD_H4}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H
Menunjukkan konstanta tempoh garis K 2 jam dengan nilai 7200.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_H4}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M1}, {@var/PERIOD/PERIOD_H
Menunjukkan konstanta tempoh garis K 4 jam dengan nilai 14400.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, PER {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_H2}, {@var/PERIOD/PERIOD_M3 PERIOD_H6}, {@var/PERIOD/PERIOD_H6}, {@var/PERIOD_H6}, {@var/PERIOD_H6}, {@var/PERIOD_H1}, {@var/
Menunjukkan konstanta tempoh garis K 6 jam dengan nilai 21600.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_H2}, {@var/PERIOD/PERIOD_M3 PERIOD_H4}, {@var/PERIOD/PERIOD_DIOD_H4}, {@var/PERIOD_M3 PERIOD_H4}, {@var/PERIOD_DIOD_H1}, {@var
Menunjukkan konstanta tempoh garis K 12 jam dengan nilai 43200.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M4 PERIOD_HIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_DIOD_H
Menunjukkan konstanta tempoh K 1 hari dengan nilai 86400.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3 PERIOD_M4}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var
Menunjukkan konstanta tempoh 3 hari K dengan nilai 259200.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD_M4}, {
Menunjukkan konstanta tempoh garis K 1 minggu dengan nilai 604800.
nombor
{@fun/Market/exchange.GetRecords exchange.GetRecords}, {@var/PERIOD/PERIOD_M1 PERIOD_M1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M15 PERIOD_M15}, {@var/PERIOD/PERIOD_M30 PERIOD_M30}, {@var/PERIOD/PERIOD_H1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M3 PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var
LOG_TYPE_BUY adalah nilai pilihan untukLogType
parameter fungsi {@fun/Trade/exchange.Log exchange.Log} yang menetapkan log yang dicetak olehexchange.Log
fungsi untuk menjadi log pesanan beli.
Nilai LOG_TYPE_BUY ialah 0.
nombor
{@var/LOG_TYPE/LOG_TYPE_SELL LOG_TYPE_SELL}, {@var/LOG_TYPE/LOG_TYPE_CANCEL LOG_TYPE_CANCEL}
LOG_TYPE_SELL adalah nilai pilihan untukLogType
parameter fungsi {@fun/Trade/exchange.Log exchange.Log} yang menetapkan log yang dicetak olehexchange.Log
fungsi untuk menjadi log pesanan jual.
Nilai LOG_TYPE_SELL ialah 1.
nombor
{@var/LOG_TYPE/LOG_TYPE_BUY LOG_TYPE_BUY}, {@var/LOG_TYPE/LOG_TYPE_CANCEL LOG_TYPE_CANCEL}
LOG_TYPE_CANCEL adalah nilai pilihan untukLogType
parameter fungsi {@fun/Trade/exchange.Log exchange.Log} yang menetapkan log yang dicetak olehexchange.Log
fungsi untuk menjadi log pembatalan pesanan.
Nilai LOG_TYPE_CANCEL ialah 2.
nombor
{@var/LOG_TYPE/LOG_TYPE_BUY LOG_TYPE_BUY}, {@var/LOG_TYPE/LOG_TYPE_SELL LOG_TYPE_SELL}
Struktur