Questions from Beginners MQL4 MT4 MetaTrader 4 - page 99

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
I want to make a chick to count profit after every 5 orders. it seems to count, but there is an error "4051 Invalid value of function parameter" why?
int step=input_step;
void start()
{
int h, history=OrdersHistoryTotal();
double orderProfit=0;
if(history==step)
{
for(h=history; h<=history; h--)
{
if(OrderSelect(h,SELECT_BY_POS,MODE_HISTORY)==true)
{
orderProfit=orderProfit+OrderProfit();
Print("profit=",orderProfit);
}
}
step=step+input_step;
}
return;
}
Hello Dear Guru ...
Scrolling through data in terminal window > History ...
... ...and somehow moved the location of the Terminal window above the chart windows ...
... Can someone suggest how to move the Terminal window back down below the chart windows?
I would be very THANKFUL.
Hello Dear Guru ...
Scrolling through data in terminal window > History ...
... ...and somehow moved the location of the Terminal window above the chart windows ...
... Can someone suggest how to move the Terminal window back down below the chart windows?
I would be very THANKFUL.
Grab the bar below the cross with your mouse and drag it wherever you like.
Hi, could you please tell me how to make an EA stop trading after three losses (with the same magic number)? After one loss this way
int flag==0;
for(int pos_buy=OrdersHistoryTotal()-1; pos_buy>=0; pos_buy--)
{
if(OrderSelect(pos_buy,SELECT_BY_POS,MODE_HISTORY) && OrderType()==OP_BUY)
{
if(OrderSymbol() == Symbol() && (OrderMagicNumber() == Magic_buy )&&(OrderProfit()>0))
flag=1; }}
What about three losses...?
Grab the bar below the cross with your mouse and drag it wherever you like.
Thank you ... I double-clicked it and dragged it down... I didn't think of it myself.
Hi, could you please tell me how to make an EA stop trading after three losses (with the same magic number)? After one loss this way
int flag==0;
for(int pos_buy=OrdersHistoryTotal()-1; pos_buy>=0; pos_buy--)
{
if(OrderSelect(pos_buy,SELECT_BY_POS,MODE_HISTORY) && OrderType()==OP_BUY)
{
if(OrderSymbol() == Symbol() && (OrderMagicNumber() == Magic_buy )&&(OrderProfit()>0))
flag=1; }}
What about three losses?
I'm a beginner myself. maybe it can be done this way
I'm a beginner myself. It could probably be done like this
Thank you very much, it all worked out.
Hi.
Can you tell me how to limit EA trading by time.
I've tried a lot of methods from the forum, but nothing worked, I don't understand anything about writing.
It would be nice if you could just point the finger at what to put in.
Hello, could you please tell me how to make an EA stop trading after three losses (with the same magic number)? After one loss this way
int flag==0;
for(int pos_buy=OrdersHistoryTotal()-1; pos_buy>=0; pos_buy--)
{
if(OrderSelect(pos_buy,SELECT_BY_POS,MODE_HISTORY) && OrderType()==OP_BUY)
{
if(OrderSymbol() == Symbol() && (OrderMagicNumber() == Magic_buy )&&(OrderProfit()>0))
flag=1; }}
How about three losses...?
I'm just learning too!!! Flag++, if (flag==3)exit;
And the loss is less than zero.Hi.
Can you please advise how to timeframe the EA.
I tried a lot of methods from forum, but nothing works.
It would be nice if I could just point the finger where to insert the message.
I can't send you the finished code, I'm browsing from my phone.
There is a function that returns bar open time
Try adding a number to the function which will return the open time of the bar with the period of a day
Returns the value of the bar open time (specified by the shift parameter) for the corresponding chart.
datetimeiTime(
stringsymbol,// symbol
inttimeframe,// period
intshift//shift
);
Period day
Shift 0
iTime(euro, day, today is zero)+1= Time 00-00-01
There are 60 seconds in one minute
iTime(euro, day, today is zero)+60= time 00-01-00-00 and so on.
For example, we want our EA to start working on 01-00-00
if((iTime(Symbol(),PERIOD D1,0)+3600)<TimeCurent() work
That's all I can help you with on the phone.
You can also return the current hour minutes and compare them, good luck!