Last active
October 16, 2022 04:01
-
-
Save natyrix/1e39fe041e9ed51dc8e338281ac96fb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function runTest(e){ | |
e.preventDefault() | |
try{ | |
setIsLoading(true) | |
let response = await axios.post(`${BASE_URL}/get_backtest_scene`, { | |
"start_date":startDate, | |
"end_date":endDate, | |
"indicator":selectedindicator, | |
"initial_cash":initCash, | |
"stock":selectedCoin, | |
"user_id":User.id, | |
}) | |
console.log(response.data) | |
let data = response.data; | |
if(data!==undefined){ | |
if(data.success){ | |
alert(data.message) | |
}else{ | |
alert(data.error) | |
} | |
} | |
else{ | |
alert("Something went wrong") | |
} | |
}catch(e){ | |
console.log(e) | |
alert(e.message) | |
}finally{ | |
setIsLoading(false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment