{"xml":"<xml xmlns=\"http://www.w3.org/1999/xhtml\">\n <variables>\n <variable type=\"\" id=\"CUnhT=2QQya8+dUEgj0W\">ticker1</variable>\n <variable type=\"\" id=\"-xl={KB09@geORu=ORZB\">ticker2</variable>\n <variable type=\"\" id=\"YXD1A6G~dGcHiAg@1B)@\">diff</variable>\n </variables>\n <block type=\"ext_exchange_SetContractType\" id=\"6:?at}X85y|$0nIHEsk=\" x=\"92\" y=\"53\">\n <field name=\"INPUT_0\">1</field>\n <value name=\"INPUT_1\">\n <shadow type=\"text\" id=\"0nxm(YJ:LEXugR:ubFh;\">\n <field name=\"TEXT\">quarter</field>\n </shadow>\n </value>\n <next>\n <block type=\"ext_exchange_SetContractType\" id=\"^.VGjPVcFC47F~cB4,Vo\">\n <field name=\"INPUT_0\">0</field>\n <value name=\"INPUT_1\">\n <shadow type=\"text\" id=\"l#*K}{JMGuKMfQu[:YK?\">\n <field name=\"TEXT\">this_week</field>\n </shadow>\n </value>\n <next>\n <block type=\"controls_whileUntil\" id=\"VWKIXl]e;;A3L|%7u^Z@\">\n <field name=\"MODE\">WHILE</field>\n <value name=\"BOOL\">\n <block type=\"logic_boolean\" id=\"C|T=r~o=S;a~rmKO.G8!\">\n <field name=\"BOOL\">TRUE</field>\n </block>\n </value>\n <statement name=\"DO\">\n <block type=\"variables_set\" id=\"pddV$``z0@4GVJN:O]@{\">\n <field name=\"VAR\" id=\"CUnhT=2QQya8+dUEgj0W\" variabletype=\"\">ticker1</field>\n <value name=\"VALUE\">\n <block type=\"ext_exchange_GetTicker\" id=\"gsrhy`blU?m-];I]~0R$\">\n <field name=\"INPUT_0\">0</field>\n </block>\n </value>\n <next>\n <block type=\"variables_set\" id=\"8ncRSoG8%^gQH3Bin!Wn\">\n <field name=\"VAR\" id=\"-xl={KB09@geORu=ORZB\" variabletype=\"\">ticker2</field>\n <value name=\"VALUE\">\n <block type=\"ext_exchange_GetTicker\" id=\"#HFxH5G(Kl|$59T@UWeL\">\n <field name=\"INPUT_0\">1</field>\n </block>\n </value>\n <next>\n <block type=\"controls_if\" id=\";464c}_|aIHp/`yIM(=;\">\n <value name=\"IF0\">\n <block type=\"logic_operation\" id=\"pZX7ifC=qhO-~qX{?T39\">\n <field name=\"OP\">OR</field>\n <value name=\"A\">\n <block type=\"logic_negate\" id=\"UFzS)Ph(sCKp1pF%7y[~\">\n <value name=\"BOOL\">\n <block type=\"variables_get\" id=\"ELs+.VQwqgB79!CV-$p9\">\n <field name=\"VAR\" id=\"CUnhT=2QQya8+dUEgj0W\" variabletype=\"\">ticker1</field>\n </block>\n </value>\n </block>\n </value>\n <value name=\"B\">\n <block type=\"logic_negate\" id=\"=C@BX3ClDiti|OAEs3{S\">\n <value name=\"BOOL\">\n <block type=\"variables_get\" id=\"](YW?8,/??m.{5MJ~!w.\">\n <field name=\"VAR\" id=\"-xl={KB09@geORu=ORZB\" variabletype=\"\">ticker2</field>\n </block>\n </value>\n </block>\n </value>\n </block>\n </value>\n <statement name=\"DO0\">\n <block type=\"controls_flow_statements\" id=\"V*0|6M_vJ[]g|7eB^nmX\">\n <field name=\"FLOW\">CONTINUE</field>\n </block>\n </statement>\n <next>\n <block type=\"variables_set\" id=\"~Rbt*]b,`%-hX7YNr-n%\">\n <field name=\"VAR\" id=\"YXD1A6G~dGcHiAg@1B)@\" variabletype=\"\">diff</field>\n <value name=\"VALUE\">\n <block type=\"math_arithmetic\" id=\"F.Z=uLW0`4gu%[O1lT1N\">\n <field name=\"OP\">MINUS</field>\n <value name=\"A\">\n <shadow type=\"math_number\" id=\"M@sGQ{.Vevh8EEYZ2Ui_\">\n <field name=\"NUM\">1</field>\n </shadow>\n <block type=\"ext_TickerOf\" id=\"w#Nh:},3TOzq`9Nr:x,_\">\n <field name=\"INPUT_0\">Last</field>\n <value name=\"INPUT_1\">\n <block type=\"variables_get\" id=\"VWxz`y$r7aZ`Hnfb/;th\">\n <field name=\"VAR\" id=\"CUnhT=2QQya8+dUEgj0W\" variabletype=\"\">ticker1</field>\n </block>\n </value>\n </block>\n </value>\n <value name=\"B\">\n <shadow type=\"math_number\" id=\"OE@G?*.GK/$5@=,y6Ojy\">\n <field name=\"NUM\">1</field>\n </shadow>\n <block type=\"ext_TickerOf\" id=\"h;l}[i[1[_}|GTV,ANv*\">\n <field name=\"INPUT_0\">Last</field>\n <value name=\"INPUT_1\">\n <block type=\"variables_get\" id=\")0rDG*pL7?we@d8$=;Rp\">\n <field name=\"VAR\" id=\"-xl={KB09@geORu=ORZB\" variabletype=\"\">ticker2</field>\n </block>\n </value>\n </block>\n </value>\n </block>\n </value>\n <next>\n <block type=\"ext_Log\" id=\"6T21lmGfrJ*4xTsQ2~:4\">\n <value name=\"VALUE\">\n <shadow type=\"text\" id=\"w`FO^ufB#_Qit=!iHh?7\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n <block type=\"text_join\" id=\"1^`CzN^wb0P0gf=(3QFX\">\n <mutation items=\"2\"></mutation>\n <value name=\"ADD0\">\n <block type=\"text\" id=\"T#]`WN1x$PC/2v~k4xPU\">\n <field name=\"TEXT\">当周价格 - 季度价格</field>\n </block>\n </value>\n <value name=\"ADD1\">\n <block type=\"variables_get\" id=\"XZ-j;-zKY0!f]9`AO?$K\">\n <field name=\"VAR\" id=\"YXD1A6G~dGcHiAg@1B)@\" variabletype=\"\">diff</field>\n </block>\n </value>\n </block>\n </value>\n <next>\n <block type=\"ext_LogProift\" id=\"[CiXPd-@e}yh(l1yB1T]\">\n <value name=\"INPUT_0\">\n <shadow type=\"math_number\" id=\"A7}AvE1=fCF0YHXI3cg[\">\n <field name=\"NUM\">0</field>\n </shadow>\n <block type=\"variables_get\" id=\"u`dWlYX4=bINKa+A9#mj\">\n <field name=\"VAR\" id=\"YXD1A6G~dGcHiAg@1B)@\" variabletype=\"\">diff</field>\n </block>\n </value>\n <next>\n <block type=\"ext_Sleep\" id=\"l0h6/Kh$4]2eK.`xP*?z\">\n <value name=\"INPUT_0\">\n <shadow type=\"math_number\" id=\"32!IfW{DCG4j$3[;yV_H\">\n <field name=\"NUM\">2</field>\n </shadow>\n </value>\n </block>\n </next>\n </block>\n </next>\n </block>\n </next>\n </block>\n </next>\n </block>\n </next>\n </block>\n </next>\n </block>\n </statement>\n </block>\n </next>\n </block>\n </next>\n </block>\n</xml>","javascript":"function main() {\n var ticker1, ticker2, diff;\n\n\n exchanges[1].SetContractType('quarter');\n exchanges[0].SetContractType('this_week');\n while (true) {\n ticker1 = _C(exchanges[0].GetTicker);\n ticker2 = _C(exchanges[1].GetTicker);\n if (!ticker1 || !ticker2) {\n continue;\n }\n diff = ticker1.Last - ticker2.Last;\n Log(String('当周价格 - 季度价格') + String(diff));\n LogProfit(diff);\n Sleep(2 * 1000);\n }\n}"}
ウラありがとうございました.
ウラ呼び出しが返信できないように見えるか? 理由は不明です.
発明者 量化 - 微かな夢この戦略はデモで,2つの契約の差をどのように扱うかを示しています. OKEXの2つの先物取引所を追加する必要がある. 図のように: /upload/asset/f37aaddd0d4f019f8ab504047edae5af.png