Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 973
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
Question to programmers.
I have an EA which sets a stop loss and take profit at a specified number of points when opening an order. We have to make it in the following way,
to open a pending order of the same size instead of a stop loss.
I changed the following line
if (!OrderModify(OrderTicket(),OOP,SL,TP,0,White)) Print("Error OrderModify ",GetLastError());
to
OrderSend(Symbol(),OP_BUYSTOP,1*Lots,Ask+Stoploss*Point,3,0,0,0) ; //Put a Buy Pending
The order is placed, but not one, as it should be; it hits a new one every second, until the EA is disabled. What do I need to adjust?
I want to place one pending order on one open order?
I would appreciate any constructive feedback.
Thank you.
Question to programmers.
I have an EA which sets a stop loss and take profit for a specified number of points when opening an order. We have to make it in the following way,
Instead of a stop loss, a pending order of the same size will open.
...Instead of the stop order, the order is placed, but not one, as it should be, but every second a new one is placed, until the EA is switched off. What do I need to change?
to put one pending order on one open order?
I would appreciate any constructive feedback.
Thank you.
The problem mentioned above has been solved. Thank you.
me again, I haven't changed the code, all the code was above.
void Fr_sign()
{
double gdClose_array[1];
if(CopyClose(_Symbol,PERIOD_CURRENT,1,1,gdClose_array)!=1) return;
Print("Close price = ",DoubleToStr(gdClose_array[0],_Digits));
}
Result of run on 5 min timeframe from Monday to Friday
2015.01.12 00:00 111 EURUSD,M5: Close price = 1.05708
2015.01.12 14:30 111 EURUSD,M5: Close price = 1.05708
2015.01.13 03:49 111 EURUSD,M5: Close price = 1.05708
2015.01.13 20:30 111 EURUSD,M5: Close price = 1.05708
2015.01.14 10:20 111 EURUSD,M5: Close price = 1.05708
2015.01.15 11:00 111 EURUSD,M5: Close price = 1.05708
2015.01.15 23:59 111 EURUSD,M5: Close price = 1.05708
The value does not change during the whole testing period
did a code run on a second laptop, result:
2015.01.12 00:00 111 EURUSD,M5: Close price = 1.18402
2015.01.12 05:28 111 EURUSD,M5: Close price = 1.18558
2015.01.12 05:30 111 EURUSD,M5: Close price = 1.18605
2015.01.12 18:46 111 EURUSD,M5: Close price = 1.18276
2015.01.13 18:00 111 EURUSD,M5: Close price = 1.17806
2015.01.13 19:02 111 EURUSD,M5: Close price = 1.17778
i.e. normal result
Reinstalled the software, seems to have solved the problem,
Paladin80 thanks for your participation.
I threw an EA on a Mt4 chart.
I have made changes in mqlEditor. I pressed the compile button. The EA should restart on a chart. But it will not.
I have to reset the EA on the chart in order to restart it.
What is the problem?
I threw an EA on a Mt4 chart.
I have made changes in mqlEditor. I pressed the compile button. The EA should (it should not!) restart on a chart. But it hasn't.
I have to reset the EA on the chart for it to be restarted.
What is the problem?
After changing the code, the EA already running on the chart is not replaced by itself.
After changing the code, I compile the EA. Previously, after recompiling, the EA on the chart was updated.