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
Need help finishing this EA
I'm trying to code an EA (using some already made codes) which does the following:
The EA is almost done and some previous issues I had were resolved and does most of the above but I still have the following issues and at this point I don't know how to go further, so if anyone could provide the code necessary that would be very helpful.
I am a noob at MQL and I have tried looking around for the solutions to some of the issues above and am having trouble finding them. I believe the issues can be resolved quite easily with not so much complicated coding required. If anyone could provide me with a solution or solutions to any of the issues above I would, once again, greatly appreciate it.
Thanks,
madmax3
...
Try something like this :
Just replace stopLossToUse and takeLossToUse with the values you wish those to be
Friends,
I'm a newbie to MQL4 programming and need help attaching a SL & TP to an ORDERSEND with an ECN broker.
Initially, I couldn't understand why the SL & TPs were making my order result in an error until someone pointed out that one has to set the StopLoss & TakeProfit field within the ORDERSEND to "0" or else an ECN/STP broker will not execute the order.
So, my question is: How can I execute an order at Market and then immediately (or within a second or two) attach a SL/TP to that ticket?
Here's a piece of the code pertinent to my questino:
if((CurrentPriceBuy>UpperPriceTrigger) && TakeAction==1)
{
OrderSend(Sym,OP_BUY,Lots,CurrentPriceBuy,0,0,0,Comm,0,0,CLR_NONE);
TakeAction=0;
}
Can anyone help me insert code right after the OrderSend command so that I can attach a TP/SL of say arbitrarily 25pips to that specific ticket?
Any help would be greatly appreciated. Thanks in advance.
Regards,
Kasiohelp!
can someone help me make this indicator to not repaint please?
...
It is a decompiled code, but anyway look at this thread : https://www.mql5.com/en/forum/179650
It is one more renamed solar wind, so ...
can someone help me make this indicator to not repaint please?
Any ideas on how to code what I posted? My apologies if I'm being impatient or something, just want to know if it has been read.
Thanks,
madmax3
...
Add something like this in your EA at the beginning of start() procedure :Add this into the code :
That will solve your points 2 and 3 (opened orders at Friday)
First point is rather complicated to code - you will probably need to redefine that rule
Any ideas on how to code what I posted? My apologies if I'm being impatient or something, just want to know if it has been read.
Thanks,
madmax3Please help! Error number = 4103. pos = 10. Cannot Open FIle
Hi,
I am new here and new to MT programming as well. Can anyone help me on this?
I got "An error had occured. Error number = 4103. pos = 10 (cannot open file) message."
The file is saved correctly as gif but I am getting the above message. Where is the problem?
The code:
void Screenshot(int ticket, int cmd, datetime orderOpenTime, double orderOpenPrice)
{
RefreshRates();
if (cmd==OP_BUY) Comment (DateTimeInfo(),"\n","Order Open Time: ",TimeToStr(orderOpenTime,TIME_DATE|TIME_SECONDS)," Buy: ",DoubleToStr(orderOpenPrice,Digits)) ;
if (cmd==OP_SELL) Comment (DateTimeInfo(),"\n","Order Open Time: ",TimeToStr(orderOpenTime,TIME_DATE|TIME_SECONDS)," Sell: ",DoubleToStr(orderOpenPrice,Digits)) ;
string filename = Symbol()+"_"+"Demo"+"_"+ticket+"_Open.gif";
int handle = FileOpen(filename,FILE_CSV|FILE_READ);
if(handle<1)
{
if (GlobalVariableGet("_MonitorScreen_ScreenShot") != 0 )
{
if(!WindowScreenShot(filename,900,600)) Print("WindowScreenShot error: "+GetLastError());
}
}
else FileClose(handle);
}
Any help is appreciated. Thank you.
...
It works OK
The file must be in the experts\files sub-folder and I used as an example ticket number 0, so the full file name was in my example "EURUSD_Demo_0_Open.gif" and it opened it with no problem (it does it OK if you use FILE_CSV as well as with FILE_BIN). So, if it is saved in correct folder and correct name, your code works OK
Hi,
I am new here and new to MT programming as well. Can anyone help me on this?
I got "An error had occured. Error number = 4103. pos = 10 (cannot open file) message."
The file is saved correctly as gif but I am getting the above message. Where is the problem?
The code:
void Screenshot(int ticket, int cmd, datetime orderOpenTime, double orderOpenPrice)
{
RefreshRates();
if (cmd==OP_BUY) Comment (DateTimeInfo(),"\n","Order Open Time: ",TimeToStr(orderOpenTime,TIME_DATE|TIME_SECONDS)," Buy: ",DoubleToStr(orderOpenPrice,Digits)) ;
if (cmd==OP_SELL) Comment (DateTimeInfo(),"\n","Order Open Time: ",TimeToStr(orderOpenTime,TIME_DATE|TIME_SECONDS)," Sell: ",DoubleToStr(orderOpenPrice,Digits)) ;
string filename = Symbol()+"_"+"Demo"+"_"+ticket+"_Open.gif";
int handle = FileOpen(filename,FILE_CSV|FILE_READ);
if(handle<1)
{
if (GlobalVariableGet("_MonitorScreen_ScreenShot") != 0 )
{
if(!WindowScreenShot(filename,900,600)) Print("WindowScreenShot error: "+GetLastError());
}
}
else FileClose(handle);
}
Any help is appreciated. Thank you.It works OK The file must be in the experts\files sub-folder and I used as an example ticket number 0, so the full file name was in my example "EURUSD_Demo_0_Open.gif" and it opened it with no problem (it does it OK if you use FILE_CSV as well as with FILE_BIN). So, if it is saved in correct folder and correct name, your code works OK
Thanks. Yes the file is saved in the correct folder and correct name. I might try to use the FILE_BIN instead of FILE_CSV to check if the error message appears again.
...
How to make my computer show words in Russian in indicators correctly?...Thanks...