[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 126
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
Good afternoon )))) I wrote my first EA, but it turned out to be problematic))))))) This EA puts only sell orders even though the buy conditions are very simple and the EA seems not to see them.
if (ZZ2< pp1 ) { OpenPosition ("", OP_BUY, Lots_New,SLB,TPB, mn);}
if (pp1 < ZZ2) {OpenPosition("", OP_SELL, Lots_New, SLS,TPS, mn);}
If someone takes a look at the code, I'd be very grateful)))
Strange, in theory it shouldn't see the snappy SELL because you're using pa instead of pb.
double TPS= NormalizeDouble(pa-tp*po, Digits);// calculate Tp for sell
double SLS= NormalizeDouble(pa+sl*po, Digits);// calculate SL for sell
There is such a recalculation algorithm:
As I understand it, it counts all bars except the last one.
Can you tell me how to make it recalculate the last bar at i=0 (there is already a condition for this in the loop)?
Thanks so much for the answers)))) I replaced iClose with Close [0] and it worked out....though strangely...))))) thanks again)))
There is such a recalculation algorithm:
As I understand it, it counts all bars except the last one.
Can you tell me how to make it recalculate the last bar at i=0 (there is already a condition for this in the loop)?
no, you're writing >= 1 (greater than or equal to the 1st bar, i.e., you don't get to 0... change the condition to >=0
SZ
What's this about?
int iShift=i+Shift;
No, you write >= 1 (Greater than or equal to 1 bar, i.e. you don't get to 0... change the condition to >=0
SZ
What's that for?
Right, totally forgot about my "experiments". Fixed 0 to 1 a while ago and it's still there. Thank you!
iShift is a shift, set in extern.
Right, forgot all about my "experiments". I changed it from 0 to 1 a while ago and it's still there. Thank you!
iShift is a shift, set in the extern.
yeah... but you write that you need to watch the 0 bar...
then remove
your shifter from there :) - put 0...
Please help. Can the conditions below be met???
We need to make so that if the current price crosses the MA, then the algorithm in { } is triggered: