pertukaran adalah objek pertukaran, yang merupakan objek pertukaran pertama yang ditambahkan ke strategi pengaturan perdagangan langsung, pengaturan backtest, dan semua interaksi dengan pertukaran direalisasikan melalui fungsi anggota dari 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 array objek pertukaran, yang berisi semua objek pertukaran yang ditambahkan ke dalam pengaturan strategi perdagangan langsung, pengaturan backtest, bursa[0], yaitu {@var/EXCHANGE exchange}. Objek pertukaran yang ditambahkan dalam pengaturan perdagangan langsung strategi atau pengaturan backtest sesuai dengan pertukaran[0], pertukaran[1], pertukaran[2], pertukaran[n]... dalam urutan mereka 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 adalah nilai dariStatus
atribut dalam struktur {@struct/Order Order}, menunjukkan bahwa status order belum selesai.
nomor
Nilai ORDER_STATE_PENDING adalah 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}, {@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_CLOSED adalah nilai dariStatus
atribut dalam struktur {@struct/Order Order}, menunjukkan bahwa status order telah selesai.
nomor
Nilai ORDER_STATE_CLOSED adalah 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 adalah nilai dariStatus
atribut dalam struktur {@struct/Order Order}, menunjukkan bahwa status order dibatalkan.
nomor
Nilai ORDER_STATE_CANCELED adalah 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 adalah nilai dariStatus
atribut dalam struktur {@struct/Order Order}, menunjukkan bahwa status order tidak diketahui (status lain).
nomor
Nilai ORDER_STATE_UNKNOWN adalah 3.
UntukORDER_STATE_UNKNOWN
status, Anda dapat memanggil {@fun/Market/exchange.GetRawJSON exchange.GetRawJSON} fungsi untuk mendapatkan informasi status pesanan asli, memeriksa deskripsi spesifik sesuai dengan 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 adalah nilai dariType
Atribut dalam struktur {@struct/Order Order}, yang menunjukkan jenis order beli.
nomor
Nilai ORDER_TYPE_BUY adalah 0.
{@var/ORDER_TYPE/ORDER_TYPE_SELL ORDER_TYPE_SELL}
ORDER_TYPE_SELL adalah nilai dariType
Atribut dalam struktur {@struct/Order Order}, yang menunjukkan jenis order jual.
nomor
Nilai ORDER_TYPE_SELL adalah 1.
{@var/ORDER_TYPE/ORDER_TYPE_BUY ORDER_TYPE_BUY}
PD_LONG adalah nilai dariType
atribut dalam struktur {@struct/Position Position}, yang menunjukkan jenis posisi panjang.
nomor
Nilai PD_LONG adalah 0.
Untuk posisi panjang di pasar kontrak, gunakan exchange.SetDirection ((
{@var/POSISI_DIRECTION/PD_SHORT PD_SHORT}
PD_SHORT adalah nilai dariType
atribut dalam struktur {@struct/Position Position}, yang menunjukkan jenis posisi pendek.
nomor
Nilai PD_SHORT adalah 1.
Untuk posisi pendek di pasar kontrak, gunakan exchange.SetDirection ((
{@var/POSISI_DIRECTION/PD_LONG PD_LONG}
ORDER_OFFSET_OPEN adalah nilai dariOffset
atribut dalam struktur {@struct/Order Order}, menunjukkan bahwa order berada dalam arah terbuka.
nomor
Nilai ORDER_OFFSET_OPEN adalah 0.
{@var/ORDER_OFFSET/ORDER_OFFSET_CLOSE ORDER_OFFSET_CLOSE}
ORDER_OFFSET_CLOSE adalah nilai dariOffset
atribut dalam struktur {@struct/Order Order}, menunjukkan bahwa urutan berada di arah dekat.
nomor
Nilai ORDER_OFFSET_CLOSE adalah 1.
{@var/ORDER_OFFSET/ORDER_OFFSET_OPEN ORDER_OFFSET_OPEN}
Menunjukkan konstanta periode garis K 1 menit dengan nilai 60.
nomor
{@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 periode garis K 3 menit dengan nilai 180.
nomor
{@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 periode garis K 5 menit dengan nilai 300.
nomor
{@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 periode garis K 15 menit dengan nilai 900.
nomor
{@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_PERIOD_H1}, {@var/PERIOD_D_H
Menunjukkan konstanta periode garis K 30 menit dengan nilai 1800.
nomor
{@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 periode garis K 1 jam dengan nilai 3600.
nomor
{@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_M4 PERIOD_M5 PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_D
Menunjukkan konstanta periode garis K 2 jam dengan nilai 7200.
nomor
{@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_M4 PERIOD_M5 PERIOD_M5 PERIOD_M5}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_D
Menunjukkan konstanta periode garis K 4 jam dengan nilai 14400.
nomor
{@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_M5 PERIOD_H6}, {@var/PERIOD/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_M5 PERIOD_H6}, {@var/PERIOD_D_H1}, {@
Menunjukkan konstanta periode garis K 6 jam dengan nilai 21600.
nomor
{@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 PERIOD_H2}, {@var/PERIOD/PERIOD_M5 PERIOD_H4 PERIOD_H4}, {@var/PERIOD/PERIOD_M5 PERIOD_H4}, {@var/PERIOD_M5 PERIOD_H4}, {@var/PER
Menunjukkan konstanta periode garis K 12 jam dengan nilai 43200.
nomor
{@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 PERIOD_M4}, {@var/PERIOD/PERIOD_M4}, {@var/PERIOD_DIOD_H4}, {@var/PERIOD_DIOD_H
Menunjukkan konstanta periode K 1 hari dengan nilai 86400.
nomor
{@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 PERIOD_M4}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_DIOD_H1}, {@var/PERIOD_DIOD_M4}, {
Menunjukkan konstanta periode K 3 hari dengan nilai 259200.
nomor
{@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_M4}, {@var/PERIOD/PERIOD_M5 PERIOD_HIOD_M4}, {@var/PERIOD/PERIOD_M5 PERIOD_M4}, {@var/PERIOD_M
Menunjukkan konstanta periode garis K 1 minggu dengan nilai 604800.
nomor
{@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_M1 PERIOD_H1}, {@var/PERIOD/PERIOD_M3 PERIOD_M3 PERIOD_M3}, {@var/PERIOD/PERIOD_M3 PERIOD_M4 PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M4}, {@var/PERIOD_M
LOG_TYPE_BUY adalah nilai opsional untukLogType
parameter dari fungsi {@fun/Trade/exchange.Log exchange.Log}, yang menetapkan log yang dicetak olehexchange.Log
Fungsi untuk menjadi log order beli.
Nilai LOG_TYPE_BUY adalah 0.
nomor
{@var/LOG_TYPE/LOG_TYPE_SELL LOG_TYPE_SELL}, {@var/LOG_TYPE/LOG_TYPE_CANCEL LOG_TYPE_CANCEL}
LOG_TYPE_SELL adalah nilai opsional untukLogType
parameter dari fungsi {@fun/Trade/exchange.Log exchange.Log}, yang menetapkan log yang dicetak olehexchange.Log
Fungsi untuk menjadi log pesanan jual.
Nilai LOG_TYPE_SELL adalah 1.
nomor
{@var/LOG_TYPE/LOG_TYPE_BUY LOG_TYPE_BUY}, {@var/LOG_TYPE/LOG_TYPE_CANCEL LOG_TYPE_CANCEL}
LOG_TYPE_CANCEL adalah nilai opsional untukLogType
parameter dari fungsi {@fun/Trade/exchange.Log exchange.Log}, yang menetapkan log yang dicetak olehexchange.Log
fungsi untuk menjadi log pembatalan pesanan.
Nilai LOG_TYPE_CANCEL adalah 2.
nomor
{@var/LOG_TYPE/LOG_TYPE_BUY LOG_TYPE_BUY}, {@var/LOG_TYPE/LOG_TYPE_SELL LOG_TYPE_SELL}
Struktur