Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK

Программирование

Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK.
Maloboti ogulitsa akhoza kulembedwa m’chinenero china, chofanana ndi ndondomeko ya pulogalamu. QPILE ndi imodzi mwa izo, nkhaniyi idzakambirana chinenerochi, yerekezerani zinenero za QPILE ndi
LUA , komanso kupereka zitsanzo za ma robot mu chinenerochi.

Zambiri za QPILE

QPILE ndi chidule chomwe chimayimira QUIK Programmable Interface ndi Logic Environment.

Awa ndi mndandanda wamalamulo omwe amatanthauziridwa ndi malo ogwirira ntchito a QUIK. Amagwiritsidwa ntchito makamaka kuwerengera mtengo wazinthu zachitetezo. Chilankhulochi chimagwiritsidwanso ntchito:

  • kuwerengeranso kwamphamvu kwamitengo yamakasitomala pakompyuta ya broker ndi m’magawo awo. Pamapeto pake, mtengo wawo wonse umawerengedwanso;
  • kupeza zizindikiro zomwe zikusowa pogwiritsa ntchito ma aligorivimu awo ndi deta yobwereketsa malire;
  • kupanga njira yoyenera yogulitsira.

Chilankhulochi chikufotokozera kapangidwe ka tebulo: kuyika mizati ndi mizere, ndondomeko. Potsirizira pake, ntchito za masamu, zosinthika, deta kuchokera ku matebulo ena zingagwiritsidwe ntchito powerengera. Khodi ya pulogalamu yokwezedwa kuchokera pa seva ya QUIK kapena kuchokera pa disk ya wogwiritsa ntchito imasinthidwa ndi womasulira chilankhulo, chomwe chimawerengera zomwe zili mumayendedwe. Matebulo a pulogalamu imodzi ali ndi gwero limodzi la data, koma kuwerengera sikunabwerezedwe ndipo sikukhudza magwiridwe antchito adongosolo. Mukamagwira ntchito ndi matebulo a QUIK, matebulo pa QPILE ali ndi ntchito zokhazikika. QUIK kuntchito ili ndi chochotsera khodi cha QPILE. https://articles.opexflow.com/software-trading/torgovyj-terminal-quik.htm Chilankhulochi chimakulolani kufotokoza matebulo atsopano ndi dongosolo loperekedwa, kuunikira maselo okhala ndi mfundo zina, kuwerengera minda pogwiritsa ntchito masamu ndi mawu omveka. Wogwiritsa adzalandira zidziwitso ngati siginecha yamawu kapena meseji. Matebulo pa QPILE amatha kusinthidwa, kusindikizidwa, kukopera, kutumizidwa kunja kudzera pa seva ya ODBC ndi DDE. Zoyambira zoyambira zikuchokera pamatebulo a QUIK:

  • zochitika, kuphatikizapo kuphedwa ndi kupanda umunthu;
  • malamulo, kuphatikizapo kuyimitsa malamulo, pazamalonda ndi maoda – malipoti a malonda a malonda;
  • “kasitomala mbiri”, “kugula/kugulitsa”
  • deta kuchokera kwa omwe akutenga nawo mbali ndi ndalama, maakaunti ogulitsa, chida.

Matebulo ozikidwa pa QPILE sangathe kukopera ku fayilo yolemba kudzera pamindandanda yankhani ndikutumizidwa ku machitidwe owunikira luso, ndipo ma chart sangapangidwe potengera iwo. Matebulo ozikidwa pa QPILE sangathe kusefedwa kapena kusanjidwa.

Kugwira ntchito ndi tebulo

Kuti mukweze kachidindo ka pulogalamu, muyenera kusankha menyu yantchito, kenako zolemba za QPILE. Mutha kugwiritsanso ntchito kuphatikiza Ctrl + F11. Pambuyo muyenera alemba “Add” ndi kusankha ankafuna wapamwamba. Ili ndi .qpl yowonjezera ndipo dzina lake lidzawonekera mu mndandanda wa Malemba Opezeka.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKNgati pali cholakwika mu pulogalamuyo, dongosololi lipanga chidziwitso mu “Window Window”, yomwe idzakhala ndi dzina la fayilo yolakwika ndi nambala ya mzere ndi cholakwikacho. Ngati palibe zolephera zomwe zidapezeka mufayilo, zotsatirazi zidzawonetsedwa m’magawo:

  • dzina la tebulo;
  • chiwerengero cha mizati ndi makasitomala;
  • mndandanda wa zizindikiritso ndi makasitomala;
  • mndandanda wa magawo ndi code source ya fayilo.

Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKBatani la “Koperani kwanuko” lidzakulolani kuti mutenge tebulo kuchokera ku fayilo, ndipo “Patsani ku seva” idzatumiza pulogalamuyo ku seva kuti ogwiritsa ntchito onse athe kuipeza. Kuti mupange tebulo, dinani Pangani Table. Mu “Zolemba Zomwe zilipo” sankhani pulogalamu yomwe mukufuna kuchita, ikani chiwerengero cha mizere kudzera mu “Fyuluta yamakasitomala”, dziwani mizati yofunikira ndi ndondomeko yake.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKKuyimitsa ndikuyambiranso kuwerengera, kuyambitsanso kuwerengeranso ndikusintha njira, kusunga kufotokozera ku fayilo, kuwonetsa chilinganizo, ndi magawo a script akupezeka pazosankha.

QPILE amapanga

Mitundu ya data

  • Chingwe – chingwe.
  • Pawiri ndi nambala yoyandama.
  • Zosonkhanitsa – zosonkhanitsira.
  • Mapu – gulu lophatikizana – mndandanda wamagulu awiri omwe amakulolani kuti mudziwe zambiri ndi kiyi.

Mawu

Ntchito za masamu zowonjezera, kuchotsa, kuchulukitsa, kugawa zimagwiritsidwa ntchito. Mawu omveka “ndi”, “kapena”, ofanana, ochulukirapo, ocheperako, osafanana, kumanga kokhazikika “ngati … ndiye …” amagwiritsidwanso ntchito.

Ntchito

Ntchito zitha kupezeka paliponse mu pulogalamuyi ndikukhala ndi mayina osiyanasiyana. Pazonse, magulu 18 a masamu ndi magwiridwe antchito akupezeka kuti apeze zofunikira zamatebulo ndi magawo, magulu ophatikizana, mndandanda wamatebulo, ndi ntchito zina. Gulu loyamba:

  1. Ntchito zamasamu zomwe zimakulolani kubweza mtengo wa sine, cosine, tangent, cotangent wa mkangano, kuwerengera woyambitsa mkangano, kupanga nambala yosasinthika, ndi zina zambiri.
  2. Malamulo onse : NEW_GLOBAL kuti muyambitse kusintha kwapadziko lonse ndi MESSAGE kuti mutsegule mauthenga.

Zochita zogwirira ntchito:

  • Zotolera zinthu (Zosonkhanitsa) . Amakulolani kuti mupange chosonkhanitsira chatsopano, kubweza chiwerengero chofunikira cha zinthu, kusintha kapena kuyika zomwe mukufuna.
  • Associative Arrays (MAP) . Thandizani kupanga ndi kuyang’anira gululo.
  • Mafayilo – kugwira ntchito ndi mafayilo amawu, kusunga chipika cha pulogalamuyo. Dzina lafayilo likhoza kukhala ndi njira yopitako.
  • Zingwe .
  • Zithunzi . Imagwira GET_CANDLE kuti mupeze data ya makandulo ndi GET_CANDLE EX kuti ibweze gulu logwirizana.
  • Mapulogalamu . Kupanga malamulo ndikuwatumiza ku dongosolo la malonda.
  • Tags . Kumanga kwawo ndi kukhazikitsa pa tchati. Kuwonjezera, kuchotsa chizindikiro chimodzi kapena zonse, kupeza ndi kukhazikitsa magawo a lebulo linalake.

Palinso ntchito za:

  1. Kuti mupeze mizere yamatebulo a QUIK osasintha ndi mindandanda ya magawo omwe alipo . Kufikira deta ya tebulo la kuntchito. Izi zikuphatikiza GET_ITEM kuti mubweze MAP ndi GET_NUMBER_OF kuti mubweze chiwerengero cha zomwe mwalowa.
  2. Kugwira ntchito ndi tebulo lokonzekera . Malamulowa amagwira ntchito patebulo la OWN. Imawerengedwa ndi ntchito zomwe zili mundime yapitayi ndi ntchito izi. Gululi limaphatikizapo malamulo owonjezera, kusintha ndi kuchotsa mzere ndi ndondomeko, ndikuchotseratu tebulo la OWN.

Kuti mupeze ma values ​​gwiritsani ntchito:

  1. Matebulo a malonda amakono . Kupeza zidziwitso zakusinthana pogwiritsa ntchito malamulo a GET_PARAM (_EX).
  2. Quote mawindo . Kupeza zofunikira za mawu a zida.
  3. Matebulo a maudindo ndi zida ndi ndalama . Kupeza zambiri pa kasitomala, kampani, chida, akaunti ya depo ndi code.

Ntchito zautumiki – kubwezera tsiku la gawo lazogulitsa zamakono, mndandanda wamagulu, tsiku ndi nthawi yamakono, kudziwa momwe kugwirizana kulili, kusokoneza njira yowerengera.

Debugging mapulogalamu

Kuwongolera pang’onopang’ono pakugwiritsa ntchito pulogalamuyi kumachitika pawindo la “Debug”. Imatsegulidwa kuchokera ku menyu yankhani “Yambani kuwerengera mumayendedwe osintha”. Itha kutsegulidwanso ndi lamulo la breakpoint(), ndipo mzere wa pulogalamuyo uwonetsedwa mofiira. Zenera lili ndi minda yokhala ndi ma code a pulogalamu ndi ma values ​​osinthika. Pansi pa zenera pali mabatani “Chotsatira”, “Pitirizani kupha”, “Lekani kuwerengera”. Kukanikiza F5 kudzapitiliza kuchitidwa kwa pulogalamuyi, kuphatikiza Shift + F5 kuyimitsa kusokoneza, fungulo la F10 lidzalunjika pamzere wotsatira.

QPILE kapena LUA?

LUA ndi chilankhulo chatsopano chopangira maloboti ogulitsa. Monga QPILE, imayikidwa mu terminal ya QUIK. https://articles.opexflow.com/programming/lua.htm Malo operekedwa popanga maloboti ogulitsa malonda akuwonetsa ubwino wa chilankhulo cha LUA kuposa QPILE. Chifukwa chake, imatha kugwira ntchito ngati script yosaphatikizidwa ndi bytecode, yokhala ndi zida zomangira komanso njira zopangira mapulogalamu. Zinthu zolembedwa m’zilankhulo zina zitha kulumikizidwa ndi mapulogalamu a LUA. LUA imapereka mitundu 8 ya data, kuphatikiza ma metatable. Chilankhulo cha LUA chimakhala ndi ulusi wambiri, wachangu, ndipo zochitika ndi zochitika zomaliza ndizofanana. LUA ndiyofala kwambiri kuposa QPILE, ndipo zowonjezera zambiri zidalembedwera.

Chiyankhulo cha QPILE tsopano chachotsedwa. Akatswiri pamabwalo amalimbikitsa kugwiritsa ntchito LUA. Ngakhale mapulogalamu othandiza komanso othandiza akugwiritsidwabe ntchito.

Komabe, chilankhulo cha QPILE ndi chosavuta poyerekeza ndi LUA, kotero ngati mulibe chidziwitso pakupanga mapulogalamu, ndi bwino kusankha QPILE. M’chinenerochi, mukhoza kulemba robot yosavuta ngati simukusowa kuwerengera zovuta.

Momwe mungapangire loboti yogulitsa pa QPILE?

Kuti mupange mlangizi wazamalonda, mufunika mapulogalamu awa:

  1. ITS Quik.
  2. Notepad ++ code editor.
  3. Kuwongolera kwa QPILE.
  4. XML plugin kuti muzindikire ma code mu Notepad++.

Koperani ndi kukhazikitsa mapulogalamuwa. Yambitsani syntax ya chilankhulo poyika userDefineLang.xml munjira C:\Users\User\AppData\Roaming\Notepad++\
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKChoyamba, tiyeni tipange njira zotsatirazi zamalonda. Script iyenera kuwerengera Hi ndi Low kwa makandulo angapo omaliza mphindi iliyonse, yang’anani mtengo wamakono wa chida. Udindo umatsegulidwa m’njira yofunikira ngati mtengo wa chipangizocho ufika pamlingo waukulu kapena wocheperako panthawiyo. Chizindikiro chachifupi chikalandiridwa, malo aatali amatsekedwa. Roboti imagwiritsa ntchito chida cha GAZP, nthawi yake imayikidwa ku 1 min. Kuzama kwapamwamba kwambiri kumayikidwa ku makandulo 5. Kuti mulowe mu Long, lamulo limayikidwa ndikudutsana kwa mtengo wamakono wamtengo wapatali wa nthawiyo. Roboti idzalowa Short ngati mtengo wapano ukudutsa mtengo wocheperako wa makandulo a 5 awa. Lembani chipika cha code mu Notepad ++ ndi zoikamo zoyambira ndi tsiku la seva ndi nthawi. Khodi iyi ikuwonetsedwa pachithunzi pansipa.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKMizere 4 yoyamba ya code imapanga mutu wa pulogalamu. Pakati pa mizere 6 ndi 44 pali thupi la pulogalamuyo, yomwe ili ndi zomwe zili mu robot. Mizere 7 – 12 ili ndi zoikamo za ogwiritsa ntchito, zomwe zimaphatikizapo ma code a chida, gulu ndi kasitomala, nambala ya akaunti pa MICEX. Makhalidwe awa sasintha panthawi yokonza pulogalamu. Mizere 13 – 16 ndizoyambira zosinthika. Adzasinthidwa kukhala zero pachiphaso chilichonse chobwereza. Mizere 17 – 21 ili ndi chizindikiritso chogwiritsa ntchito tsiku ndi nthawi ya seva. Izi zimaperekedwa ku DATETIME ndikusinthidwa kukhala zolemba. Mizere 22 – 29 tumizani zomwe mwalandira patebulo. Khodi iyenera kusungidwa ndipo kuwonjezera kwa qpl kuyenera kufotokozedwa.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKTsegulani pulogalamuyi mu QUIK mwa kukanikiza Ctrl+F10 ndikusankha fayilo ya qpl yopangidwa. Gwiritsani ntchito kuphatikiza kwa Ctrl + F11 kuti mutsegule zenera la “Ntchito ndi Portfolios” ndikuyika nthawi yowerengera kukhala mphindi 5. Dinani Ctrl+F12 kuti muyike mizati kuti iwonetsedwe patebulo. Chithunzichi chikuwonetsa zotsatira za ntchito ya robot.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKTiyeni tiwonjeze ntchito zina zingapo ku pulogalamu yathu.
Chotchinga cha “User settings” chikuwonjezeredwa ndi NUMBER ndi INTERVAL zosintha, zomwe zidzagwiritsidwe ntchito popeza ma N bar omaliza. Ntchito ya DATETIME imayika tsiku ndi nthawi ya seva, ndipo tsiku lapano ndi nthawi zikugwira ntchito CURDATE ndi CURTIME zimayitanidwa kuchokera pamenepo. Nthawi yamakono imasinthidwa kukhala nambala pa mzere wa 24. Mzere wa 26 umayika nthawi yoti algorithm iyambe kuyambira 10:00:01 mpaka 18:40:00 UTC.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKChilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKNthawi zambiri, zizindikiro, oscillators, kuwerengera ziwerengero amawerengedwa ndi otsiriza N makandulo tchati. QPILE ilibe ntchito yosonkhanitsira kuchuluka kwa makandulo N m’nthawi zakale motere, koma pali ntchito ya GET_CANDLE yomwe imapeza makandulo patchati potengera tsiku ndi nthawi m’mawu. Khodi yathu ili ndi ntchito yopezera ma N bar omaliza OHLC (). Imapanga zosonkhanitsira ndi magawo a makandulo omaliza omwe ali pagulu la COLLECTION. Pulogalamuyi imayang’ana mtengo wa INTERVAL, ndipo ngati sichikugwera m’kati mwa 0 … 60, uthenga ukuwonetsedwa kuti mtengowo sukugwirizana ndi chiwerengero chololedwa. Zosonkhanitsira MAP zokhala ndi makandulo zimapangidwa mu mzere 88. A FOR loop povotera tchati mpaka kuya kofunikira ndi sitepe ya INTERVAL kuchoka ku chatsopano kupita ku kandulo yakale. Mu mzere wa 90, kuzungulira kwalengezedwa, loboti imabwerera m’mbuyo. Mukalandira kandulo yokhala ndi GET_CANDLE, ikeni mugulu la BARLIST pogwiritsa ntchito INSERT_COLLECTION_TEAM. Chifukwa cha kugwira ntchito kwa lamulo la OHLC () , BARLIST imadzazidwanso ndi makandulo omaliza kuchokera ku tchati cha chida mu kuchuluka kwa NUMBER. Chiwerengero cha zinthu zomwe zasonkhanitsidwa chikufunsidwa ndi lamulo la GET_COLLECTION_COUNT() ndipo linanena ndi BARCOUNT zosintha. Tsiku la seva, nthawi, makonda a INSTRUMENT ndi BARCOUNT zosintha zimanenedwa ndi SET_VALUE () ntchito mu OUTPUT. Gululi limapangidwa ndi lamulo la CREATE_MAP(). Deta imagwera patebulo lachizolowezi, lomwe lingathe kuwonedwa pa chithunzi pansipa. zosintha za INSTRUMENT ndi BARCOUNT zimanenedwa ndi SET_VALUE () ntchito mu OUTPUT. Gululi limapangidwa ndi lamulo la CREATE_MAP(). Deta imagwera patebulo lachizolowezi, lomwe lingathe kuwonedwa pa chithunzi pansipa. zosintha za INSTRUMENT ndi BARCOUNT zimanenedwa ndi SET_VALUE () ntchito mu OUTPUT. Gululi limapangidwa ndi lamulo la CREATE_MAP(). Deta imagwera patebulo lachizolowezi, lomwe lingathe kuwonedwa pa chithunzi pansipa.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK

Kugulitsa maloboti pa QPILE – mayankho okonzeka

Loboti yosuntha yapakati

Loboti yachiwonetsero siyoyenera kuchita malonda enieni.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIKLoboti ili ndi magawo 5. TSIKU, TIME, PRICE zizindikiritso zayikidwa pamlingo wa 30. ZOKUTHANDIZA ndi zozindikiritsa za TP zimayikidwa kuti zisakhale zero. Khodi ya maloboti yolembedwa pansi pa QPILE: [galari mizati = “5” ids = “14896,14897,14898,14899,14900,14901,14902,14903,14904,14905,14906,14907”

N. Moroshkin powerengera malo

Purogalamu yowerengera milingo yotsika kwambiri yololeka ndi chandamale cha malo aatali ndi aafupi pamitengo yaposachedwa yofunsa ndi kuyitanitsa. Miyezoyo imawerengedwa pamtengo wa 2 wa voliyumu yolowera. Loboti imapeza voliyumu yovomerezeka popereka kuyimitsidwa mu sitepe imodzi kuchokera pamtengo wotsegulira ndikuwerengera kuti mutsegule malo motsata kukula kwa bar. Miyezo yomwe yapezeka imalowetsedwa pawindo la terminal, lomwe pambuyo pake limawonetsedwa pamitengo yamitengo. Zochita zimakhazikika pa chida choperekedwa. Ngati malo atsegulidwa, robot imayamba kuwerengera magawo ake. Malingana ndi kusintha kwa malo, malamulo omwe amaperekedwa amasinthidwa.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK

Voliyumu fyuluta

Maloboti a portfolio powerengera kuchuluka kwa masamu a makandulo ndi kufanizitsa ndi chinthu chapakati pa coefficient X. Imagwira ntchito moyenera ndi ma chart ojambulidwa mu nthawi yosankhidwa.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK

Zosankha Agiriki

Mbiri yowerengera ndikuwonetsa “Agiriki” zosankha. Zimasiyana ndi njira ya Black-Showers.
Chilankhulo cha algorithmic QPILE chamaloboti opangira mapulogalamu a QUIK

TRIX malonda robot ya QUIK

Pulogalamuyi imachokera pa TRIX Indicator. Pamene chizindikirocho chikutseka pamwamba pa mzere wa zero, mlingo wotchulidwa, robot imatenga malo aatali. Malowa amatsekedwa ndi Take Profit, Stop Loss kapena trailing stop.

M4 Preprocessor

Pulogalamu yogwira ntchito ndi QPILE ndi Lua. Imaphatikizapo zosungidwa zakale zomwe zili ndi mafayilo omwe angathe kukwaniritsidwa, zolemba ndi mafayilo a DLL okhala ndi mawu okhazikika. Kuti mugwiritse ntchito pulogalamuyi, muyenera kumasula mafayilo omwe angathe kuchitika ndikuyika regexp2 mu C:\Windows njira. Maphunziro pa QPILE for QUIK: https://youtu.be/vMTXwDUujpI Kuyika script pa QPILE mu Quik terminal: https://youtu.be/0B7qL8Svh7I Gawo la github lomwe limafotokoza kugwiritsa ntchito chilankhulo cha algorithmic cha QPILE QUIK system workstation yomwe ili pa ulalo – https://euvgub.github.io/quik_user_manual/ch8.html. QPILE ndi chilankhulo chachikale, koma chosavuta komanso chopezeka ngakhale kwa amalonda oyambira. Maloboti ogulitsa ndi mapulogalamu omwe adziwonetsa okha kwa nthawi yayitali akupitilizabe kugwira ntchito. Komabe, pazinthu zovuta kwambiri ndi bwino kugwiritsa ntchito LUA.

info
Rate author
Add a comment

  1. Владимир Геннадьевич Евсеев

    Reply