1
Follow
0
Followers
Quiero preguntar, después de definir una variable global, ¿por qué el valor de la función posterior siempre permanece sin cambios?
Created 2018-11-13 17:27:58 Updated 2018-11-14 09:11:29
2
1932
var STATE_IDLE = 0;
var STATE_LONG = 1;
var STATE_SHORT = 2;
var State = STATE_IDLE;
function Trade(currentState, nextState) {
if (currentState === STATE_IDLE) {
if (nextState === STATE_LONG) {
exchange.SetDirection("buy");
AmountOP = InitAccount.Stocks * 10 / 2;
exchange.Buy(_C(exchange.GetTicker).Sell, AmountOP);
State = STATE_LONG;
}
Hay otras condiciones que se ejecutan y cambian el valor de State, pero ¿por qué siempre es 0 y no cambia?
Related Recommendations
JavaScript Bitmex【Recruitment】Quantitative Strategy DevelopmentHow can i get the depth of the market when backtesting?ERR_INSUFFICIENT_ASSET from huobiMyLanguage DocumentHappy Halloween / Coupon-codes for everyone -- FMZ Quant TeamAdding exchanges on our setting listIntroducing Visual Programming on FMZ QuantLooking For PartnershipGreat news! Check out our platforms’ NEW features, the “Demands & Offers” page on our website.
