How do you debug this problem? Use the following code to get position information if there are no positions in the account while ((true) { This is a list of all the different ways Var position=_C (exchange.GetPosition) is credited in the database.
if ((position ==null) {
Continue
I'm not sure.
type=position[0].Type
If this is the case, then this is the case
If (excell!==sellPrice) is equal to (excell!==sellPrice)
Cancel Pending Orders
exchange.SetDirection ((
I tried to change the condition in if, such as position[0]==null or typeof(position)==undefined, either of which didn't work or would execute the following type=position[0].The type bar returned an error.
How can this problem be solved?
xionglonghuiThe solution is as follows: This is a list of all the different ways Var Position is credited in the database. if ((position.length>0) {pos (192,210) } // Please put the code in this large parenthesis. The principle is as follows: first determine the length of the array returned by this holding function, if the length is greater than 0, it means that there is a holding information, you can not directly use null, undefine. Then you can access position[0] I'm not sure.
yumountI'm having the same problem, and I feel the need to set up an error tolerant function for exchange.GetPosition separately, otherwise the function is almost completely useless without holding. By the way, please ask the landlord how it was resolved.
Inventors quantify - small dreamsLooking at the post, I found the problem, when you call exchange.GetPosition (()) if you don't hold, it returns [], an empty array, which is not equal to null, which is your judgment. When position == is null, it is false, so it does not trigger continue, then you access position[0] The element does not exist, so it is undefine, then call his Type attribute and it returns an error.