
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
Always use #property strict in your code
This check does nothing except declare a bool variable
Profit is in currency, not pips
What is the point of this loop? You don't change the values for Loop or Loop2, so how will it ever exit the loop?
Do you really expect the order to be selected?
The Point of that loop is an infinite loop, i want my ea to run non stop. Is it wrong?
Should I change this to Loop2 then?Just looked at your code you have an error
You will never have a position thats both a BUY and a SELL.
change that line to
The Point of that loop is an infinite loop, i want my ea to run non stop. Is it wrong?
Should I change this to Loop2 then?look at OrderSelect
so we have 10 Open Positions with numbers 0-9
we are selecting 1st trade we say
next trade we say OrderSelect(2~~~
Orderselect(3~~~~ etc
hence the Loop so that we select the trades Automatically hence this line
Is a desaster waiting to happen cause Loop is a constant from what I see
Which means u will always be selecting the SAME trade over and over again
for each time the Loop runs. plus Loop = -1 I thkink that will return an error and no trade will be selected.
The Point of that loop is an infinite loop, i want my ea to run non stop. Is it wrong?
Should I change this to Loop2 then?
Yes, it is wrong. EAs should be designed to run when a new tick arrives (usually).
Read and properly study my previous amswer.
look at OrderSelect
so we have 10 Open Positions with numbers 0-9
we are selecting 1st trade we say
next trade we say OrderSelect(2~~~
Orderselect(3~~~~ etc
hence the Loop so that we select the trades Automatically hence this line
Is a desaster waiting to happen cause Loop is a constant from what I see
Which means u will always be selecting the SAME trade over and over again
for each time the Loop runs. plus Loop = -1 I thkink that will return an error and no trade will be selected.
Yes, it is wrong. EAs should be designed to run when a new tick arrives (usually).
Read and properly study my previous amswer.
Is this how its suppose to be right?
No - you don't want the loop variables at all, nor the while
and you definitely don't want to use the variable here.
Correct me if I'm wrong, "int" are numbers 0,1,2,3,4,5,6 etc right? So what you guys are saying is that my Loop should be as follows:
So u want to select a different trade with each loop.
I understand what you & Keith were saying now .
I noticed that my Stop Loss were incorrect. So i changed it to this: