You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There is not even a single Print in your code!
They were not printing I took them out
They were not printing I took them out
So instead of investigating why they are not printing, you took the Prints out of the code??!!
That makes no sense at all!
You wrote the code so you should know what it is supposed to do.
When it doesn't execute as you expect, check your code carefully.
As I said before...
Then, as a coder you should be asking yourself "Why doesn't it print the error??"
The obvious answer is because there was no error!
If there was no error, then it can only be because there was no attempt to close any trade (or because a trade was closed).
What are the possible reasons for there being no attempt to close any trade?
Only possible answers.......
There was not a trade open with the symbol.
The OrderSelect() failed.
The function was not called.
Add prints in your code to find the correct answer.
Did you check all the above?
I have removed the actual code from the above and an error is obvious.
Now lets take a look at the first block...
You wrote the code so you should know what it is supposed to do.
When it doesn't execute as you expect, check your code carefully.
As I said before...
Did you check all the above?
I have removed the actual code from the above and an error is obvious.
Now lets take a look at the first block...
Im not sure what you mean with this comment
Look at the ema condition for LongSetup to be true
So here, if LongSetup is true the ema condition cannot be true so this if will always be false.
Look at the ema condition for LongSetup to be true
So here, if LongSetup is true the ema condition cannot be true so this if will always be false.
I did that on purpose since I want the trade to close when the EMA crosses in a long position. So in this case since it is already true I can get rid of the true statement
This is my code so far. But trades still do not close when the opposite signal occurs. What do you think the problem is?
In my post #43 I included
You have completely ignored it!!