In parameter testing of the policy, repeating at different time intervals, repeating objects of multiple parameters, etc., the repeating policy is reset the next time because the parameters need to be repeatedly adjusted, and cannot be recorded.
As you can see, this is a test strategy, the code is as follows:
function main(){
while(true){
LogStatus("测试默认参数!");
Sleep();
}
}
The following are the strategic parameters:
/*backtest
start: 2017-03-01
end: 2017-03-02
period: 15
mode: 1
*/
period: 15 15 refers to 15 minutes, the platform supports periods of 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 1 day
So what's 1 hour? 1 hour is equal to 60 minutes.period : 60
I'm not going to lie to you.
So what does 1 day look like? 1 day is equal to 24 times 60 minutes.period : 1440
I'm not going to lie.
mode: 1 mode refers to the mode of retesting, supported by the retesting system模拟级别回测
, 实盘级别回测
^ Here 1 represents the index of the drop-down box, 0 is the index of the drop-down box.模拟级别回测
, 1 is实盘级别回测
。
/*defaults
number : 0
bool: false
string: Hello BotVS!
comboBox : 2
*/
Javascript
/*backtest
start: 2017-03-01
end: 2017-03-02
period: 15
mode: 1
*/
/*defaults
number : 0
bool: false
string: Hello BotVS!
comboBox : 2
*/
function main(){
while(true){
LogStatus("测试默认参数!");
Sleep();
}
}
Python
'''
/*backtest
start: 2017-03-01
end: 2017-03-02
period: 15
mode: 1
*/
/*defaults
number : 0
bool: false
string: Hello BotVS!
comboBox : 2
*/
'''
def main():
Log("OK")
You can see that both the default parameter array of the query retrieval system and the default parameter array of the query policy have been modified accordingly based on the code. Save the desired settings, no more point-to-point to set the retrieval parameters.
This way, the default retrieval parameters are not written by hand when they are first set in code, and can be set on the retrieval page and inserted directly into the code.
Note: Change args to the default
For example: When you have set the retest option (e.g. time, exchange, K-line cycle, etc.) You can click the Save Reset Settings button on the Policy Edit page to save the reset configuration in code form in the policy, and the next reset will be in this code.
Code is automatically added to the beginning of the edit area and saved as an annotation.
This way, you can save it manually, so you don't have to reconfigure the information next time.
If the rate setting of the exchange object is adjusted:
Then save the retest settings and you can see that a rate setting appears in the retested settings.
# 注意: 尽量不要手动修改 或者 设置 回测设置 (即 backtest 段代码) 代码。
kaizi1231Is it possible to generate this configuration information that can be called directly into the strategy?
hokshelato`mode: 1` seems to be invalid, and the interface always shows **analogue-level Tick**.
edwardgywNice work! is it that you add the exchange and set the buy and sell transaction fees together and give the code, you have to adjust these numbers every time
The AquariusIf you can set the balance and the balance, it's better.
Inventors quantify - small dreamsThe rate can be set directly in the policy interface.
kaizi1231Is there a way to get the rate parameter set by the retesting platform in the strategy?
Inventors quantify - small dreamsThis doesn't work, it's just code for parameters that are configured for the retest system.
Inventors quantify - small dreamsOkay, so this is the comment code itself, and it's possible that re-commenting it will cause a parsing error.
hokshelatoThis is not a refresh problem, it's because I added a comment after the sentence that BotVS can't solve correctly. You know what? /* backtest mode: 1 // tick at the disk level */ What's up? With an annotation, `mode` is always set to **0** ((analogue level)).
Inventors quantify - small dreamsHey, you said these can't be set in the code.
Inventors quantify - small dreamsIf you have a problem with this, you can try it.
hokshelatoI also asked if the current ** balance **, ** surplus **, ** buy **, ** sell ** can be set in backtest.
ZeroYou can save the configuration of the fee.
J +1
edwardgywIt's simple, set a button to save the current setting as the default setting. Once you've done that, you can generate the code yourself, insert it, or record it in the background. It's easier than it is now.
Inventors quantify - small dreamsThis is because some things are complicated and are still in the design phase, so it's up to you to decide which design is most reasonable, convenient, and efficient.
Inventors quantify - small dreamsThanks for the suggestion, this one needs to be set up too, I have documented the report Z major.