[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 458
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
During testing EA I get error 130 - wrong stops. In the NewOrder function external variables TakeProfit and StopLoss should be passed, and it seems to me I have done everything to achieve this, but as print shows zeros are passed. I understand the reason of this error lies here but I have not been able to find it yet. Please help me.
extern int TakeProfit=100;
extern int StopLoss=100;
....................................
NewOrder(OP_BUYSTOP, Lot, TakeProfit, StopLoss);
NewOrder(OP_SELLSTOP, Lot, TakeProfit, StopLoss);
int NewOrder(int Cmd,double Lot,int TakeProfit,int StopLoss)
The problem here is that there are global variables StopLoss and they are passed to the procedure as parameters. It's better to rename them in the procedure.
Zhunko:
Trend lines.
The problem here is that there are global StopLoss variables and they are also passed to the procedure as parameters. It is better to rename them in the procedure.
But it didn't help much. TaPr and StLo= 100, but PR, SL and TP are zero for some reason.....You are right. It is really more logical. Corrected:
Hello, can you help me write a condition so that the order opens only once, at this point it opens on every tick
I just need to do something to make it look like this: if I already have an order already placed, it won't open another one without an OrderComment, I have no idea what to do with it yet
Thanks in advance
How about more details? At least give me a link where to read?
Unless you put it on the chart yourself, it will not be reflected during the EA. How did you do this?
But it didn't help much. TaPr and StLo= 100, but PR, SL and TP are zero for some reason.....You're right. It does make more sense that way. Corrected:
please advise how to calculate loss-making trades.
i.e. trades that were closed by a stop loss.
and reset the counter after a profitable trade.
I.e. after closing on Take Profit to reset the counter to zero.
Initial counter digit = 1
All trades, both buy and sell, should be counted.
Thank you! ))) Couldn't see the error until so clearly compared
please advise how to calculate loss-making trades.
i.e. trades that were closed by a stop loss.
and reset the counter after a profitable trade.
I.e. after closing on Take Profit to reset the counter to zero.
Initial counter digit = 1
All trades, both buy and sell, should be counted.
Closing on a stop loss does not mean that the trade is losing, and vice versa. Unless, of course, stops and takes were set at the opening and have not been touched again.