Being a rookie means you have the greatest potential to learn and improve, exciting!. An expert may be bored of doing the same thing over and over again before something new comes along.
It takes 10% of the time to learn 90%Ā but,Ā 90% of the time to learn the last 10%.
It maybe an idea to set the 143000 as a variable at the top of the code, since its used three times.
Using it as a variable allows you to change the time in all three places from one point,Ā if needed.
Also, if you type the variable name wrong, you will get the unknown variable error to warn you.
There’s a problem on the same line as before, but with the logic.
I think the three time conditions need to be overall enclosed in brackets for the OR operation to work correctly without affecting c1.
The lack of brackets is AND’ing theĀ c1 to the last time condition on one branch of the OR.
If not onmarketĀ Ā Ā andĀ Ā Ā (time = 143000Ā ORĀ Ā (time > 143000 AND time[1] < 143000))Ā Ā Ā andĀ Ā c1Ā then
I think what was happening was, when time = 143000, everything in the otherĀ ORĀ branch was irrelevant, and a order was taken regardless of c1.
1 OR 0 = 1
The common factor between different ema setting would be 143000.
Not sure though what yourĀ intensions are with the times.
- Ā if timeĀ = 143000 then other OR branchĀ ignored…
- Ā if time > 143000(144500) then AND’ed to time[1] <143000 which will be 143000Ā @15mĀ and hence (1.)Ā Ā 1 AND 0 = 0
This was why order was taken regardless of C1 because of the AND’ing of c1 to the OR branch which never was needed @15m, and if an entry, it would be taken at 143000.
regards