The disadvantage of this mechanism is obvious: on a K-line, only one trade can be generated, and the price is usually based on the closing price of the K-line. And a K-line can only get four prices from high to low, and no information can be obtained about how the price changes in a K-line, whether the highest price occurs first or the lowest price occurs first, etc. For example, the 1 hour K-line is sure to get a trade information every few seconds, and the trade instructions will be sent in the disc instead of waiting for the K-line to end.
The FMZ platform resets both analogue-level resets and real disk-level resets. Analogue-level resets generate 14 reset time points on each underlying K-line cycle, based on the tick generated by the underlying K-line cycle.The real disk level is the real collected tick, about once every few seconds, and currently partially supports real depth ((contains 20 files), real penny transaction.There is a large amount of data and a slow rate of retracement, so it is not possible to retracement particularly long time. FMZ's retracement mechanism allows the strategy to be traded multiple times on a single K line, avoiding the situation where only close price transactions can be done, more accurate and taking into account the retracement speed.https://www.fmz.com/digest-topic/4009
The iterative policy framework is the same as the real disk, and is a dead loop. Since iteration jumps at different iterative points, this time can be done without Sleep, which automatically jumps to the next time point at the end of one loop.Sleep(10)
I'm not going to be able to do this.
The retargeting engine takes a snapshot of the spot price at the time of the retargeting and the price of the buy price is higher than the sell price. If the transaction is not completed, a pending list is generated. The transaction requires a sliding point to ensure.
GetRecords()
The default cycle of a function can also be specified in the code.As mentioned earlier, using an API interface on a physical disk can cause access to fail and return.null
This will cause errors and cause the hard drive to stop, so the strategy is to be tolerant of errors.
Common misconceptions:
Before using the API to return data, it is necessary to judge whether it is null.
//1.判断为null进行处理
var ticker = exchange.GetTicker();
while(ticker == null){
Log('ticker 获取出错');
ticker = exchange.GetTicker();
}
Log(ticker.Last);
// 2.判断不为null再进行引用
var ticker = exchange.GetTicker();
if(!ticker){
Log(ticker.Last);
}
// 3._C()函数重试
var ticker = _C(exchange.GetTicker);
Log(ticker.Last);
// 4. try catch容错
try{
var ticker = exchange.GetTicker();
Log(ticker.Last);
}
catch(err){
Log('ticker 获取出错');
}
If you want to get the wrong information, you can use it.GetLastError()
, which returns the last error message string, can be used for differential processing of errors.
There are a lot of common misconceptions about the forum top posts:https://www.fmz.com/bbs-topic/1427The following is a summary of some of the problems you may encounter by searching Ctrl+F.
How to place a trustee?
Add a host for more details.
Can you find a strategy for transcribing?
https://www.fmz.com/marketsSome people offer copywriting services or consult in groups, and need to contact themselves at their own risk.
Access to all interfaces prompts timeout
This refers to access to the exchange interface overtime, if it occurs occasionally is not a problem, if it is constantly prompted to say that the network in which it is not accessible, the need to use an overseas server.
Error in the following command:
The system reports errors, usually written errors for the strategy, and attempts to close a position without holding or with insufficient number of holdings will cause the error.
symbol not set
Futures exchanges retest, no contracts are set in the code, see exchange.SetContractType
BITMEX 429 error, {
error :{ message : Rate limit exceeded retry in 1 seconds...... }}
The frequency of access to the exchange interface is too high.
{“status”:6004,“msg”:“timestamp is out of range”}
Server timestamp is out of range and needs to be updated to avoid excessive deviation.
GetOrder(455284455): Error: invalid order id or order cancelled.
Some exchanges canceled orders, and the information about the order was not maintained and could not be accessed.
GetOrders: 400: {“code”:-1121,“msg”:“Invalid symbol.”}
Invalid transaction pairs, check whether the transaction pair is set to error.
Secret key decrypt failed
Failed to resolve API KEY. If you have modified the FMZ password after configuring APIKEY, try adding an exchange page in FMZ and reconfiguring the exchange APIKEY.
Signature not valid: Invalid submission time or incorrect time format
It is recommended to use a Linux server, or install time sync software on windows systems where this problem occurs.
Why set up a global proxy so that the trustee can't access the exchange API?
Global proxies do not have proxy host network ports, so it is best to deploy hosts with overseas servers due to latency issues.
How can the strategy be kept local instead of being uploaded to the FMZ?
Using Python, you can import a local file, save the policy normally written in FMZ's API as a file on your own server under the execution path, and read the execution directly.
#!python2.7
def run(runfile):
with open(runfile,"r") as f:
exec(f.read())
def main():
run('my.py')
How to use an exchange's test net or change the API base address
You can switch directly to the corresponding API base address using exchange.SetBase.
exchange.SetBase("https://www.okex.me")
gaoencheer api
ScienceHow do I implement the policy locally? I wrote a simple Log output statement and followed the end-of-sentence operation. The first step is to use a laptop as a server and run the host program. The second step is to write a simple test.py program for log output information (the FMZ API interface function); The third step, as at the end of the text, is to write a runfile and run it through run.py calling test.py. /upload/asset/1add39483ef82d45b3ce3.png
gyp9I bought the NetEase Cloud Quantitative Trading course, now where to go?
MonuRajak many
MonuRajak hi
I'm not sure.Learning
wqyThere's a small typo, GetAccount gets the account. In the introduction, FrozenStocks is supposed to be a frozen balance, not a available balance.
Lieutenant Jaya.getorder outtime get order outtime, exchange of okx, what to do
The Tree of LifeIf the collateral rate is not available, the collateral rate to 0% will be forced to break even.
shifeng2020I'm looking at a 1-minute k-string operation, so the sleep time of the Python dead loop can be set to 0.1s, which is sleep ((100)
East Windmillsexchange.SetDirection (("closebuy"); // if it is a permanent contract, directly set exchange.SetDirection (("sell") I tried OKex's perpetual contract here, and if it's set to sell, it's just empty, not cheap.
East Windmillsexchange.SetDirection (("closebuy"); // if it is a permanent contract, directly set exchange.SetDirection (("sell") I tried OKex's perpetual contract here, and if it's set to sell, it's just empty, not cheap.
East WindmillsThere are two spelling errors in the GetOrders code. One is that function is written as a function and the other is that it is written as a condition of the for loop.
East WindmillsIt was my fault. exchange.Buy ((-1, 0.5), the trading pair is ETH_BTC, the market price list represents the purchase of ETH for 0.5BTC exchange.Buy ((price, 0.5), if this is the limit list, it represents buying 0.5ETH at the price of the price
East Windmillsexchange.Buy ((-1, 0.5), the trading pair is ETH_BTC, which represents the market price of buying ETH of 0.5BTC This is supposed to be the market price for buying 0.5 ETH of nickel.
gyp9Thank you.
The grassIt has been on the web https://study.163.com/course/courseMain.htm?share=2&shareId=400000000602076&courseId=1006074239&_trace_c_p_k2_=c3f5d238efc3457d93c8b92c0398d2b2
The grassWeight Watchers adds a homepage to your group.
wqyI'm having trouble asking if we have an official chat group. Sometimes I don't know where to ask questions.
The grassChanged
The grassAcquire again
The grassYou can use GetRawJSON or view the info in the field
East WindmillsI found a lot of spelling mistakes in the code, haha.
The grassHi, corrected, thank you for pointing out the error.
The grassSome perpetual contracts allow bidirectional holdings, which need to be set to break even.