MQL4 and MetaTrader 4 - page 178

Hi everyone, I have a problem with my EA trades, now I will show you the code with a screenshot of a trade (it happens often) void OnTimer () { //--- if (currBars != Bars ){ calculate_price_levels(); //debug_levels(); check_nearest_levels(); if (is_session()){
How is it possible that the alert "total trades" is returning '3', but "have we had two trades?" is returning 'false'. This makes no sense... my head hurts. Please help. bool haveWeHadTwoTrades; int totalTrades = 0 ; for ( int i = OrdersHistoryTotal()- 1 ; i >= 0 ; i--) { if (
  Discussion  (1585   1 2 3 4 5 ... 158 159)
Any suggestion about EAs testing, suggestion EAs to test and any other talking and advice please post here
Hello friends, I am building my first EA and have all my calculations done. I want the calculations to run every time a new candle opens on a 1H chart. How do i start the code for that? For Example: Every time a new candle opens: 1. A calculation is done. 2. Based on that calculation, a new order is
Hi friends, i made this EA that launches two diferent orders, so the thing is once the first target is hit, it is supposed to move the second order to a break even point, i used this code but it will only move the stoploss sometimes, most times it wont do anything wich is weird, it is like sometimes
I can't copy my signal onto my MT 4 account? How do I link them? Do I need to get a VPS first? Any suggestions on copy trading in general? Thanks, Colin
Hey, am making an indicator that counts the total (bid) tick size up (and down for another indicator window) at rate of per n seconds.....in the "indicator iteration function" I couldnt find funtions that work for this formula (I tried "BidPrice - LastBidPrice" for Range function but there are other
Hi, I’m looking to make my own dashboard in Python where by entering a MT4 account number and investor password I am able to get data from the account such as live account balance, equity, trade history etc. What method would be best to do this so I can then go and learn
I'm trying to find an EA for the mt4 platform that will immediately open a new pending order with the same specs as the original trade that closed for profit.  For example, if I had a buy trade enter on EUR/USD at 1.1300 and a TP of 1.1310 which closed for profit, I would like an EA to immediately...
VPS says realtime copying is disabled and signal server is disconnected. Even its created all the open trades. Even thing is setup correctly can somebody tell me how to solve this problem
void TrailStops() { for ( int i = 0 ; i < OrdersTotal (); i++) { if (! OrderSelect (i, SELECT_BY_POS, MODE_TRADES)) { continue ; } if (OrderSymbol() != Symbol ()) { continue ; } // trailing stop on Long Positions if
Good evening I had a little problem recently with the function floor(); I had a value wich I increased with 0.1 everytime I pressed a button. I also used floor() so if the value was like 0.38 it increases just to 0.4 and not to 0.48 the next time I press the button. But I just couldnt get pass the
Hello Sir: You currently provide this report in MT4 platform as a Detailed Report for a set of forex trades, both longs and shorts together as a combined statement. It will be very useful for traders like me to separate the profit factor (PF) for long trades and short trades individually, so that we
In the MQL4 Reference guide, it says: "returns the requested property of the order(string)." However, there are two string arguments for OrderSend right? The symbol, and the comment. So which will this return? Both? Either
If an order gets sent through the OrderSend function as OP_BUYLIMIT, does it maintain that order type (i.e., 2) AFTER the entry price is reached and the order is entered? Or does the type then become 0, since it's no longer a buy limit pending order
[Deleted]
Hello, i want to build a simple indicator about my profit-loss analysis... as Select by pos is related to Ticket ID/Order Date... is it possible to create the same one but sort by Closing Date
How To Draw These Arrow? I can't see them in wingdings or anywhere else. Can Someone Please help me
hi guys I have a problem in meta 4 alerts most indicators cant show the name of my symbols which are not in English and show ???? instead of symbol name any one can help? i attached a sample
Here is an example of putting function pointers to good use. Those who know javascript or python will likely recognize this pattern immediately.  This is a generic object vector that I frequently use, and I've added a filter method which takes a function as an argument and returns a pointer to a new...
[Deleted]
Hello So, MathMod() eh? What's this crazy function all about? I''ve coded up a partial position close once certain parameters are met, have have set the amount of lots with which the position is to be closed by as a fraction (i.e. 1/2 = half of the lotsize etc). This works swimmingly, but I wanted
Hello, I am looking for this indicator in MT4 *** It is the distance from the moving average in percentage Can someone know where I can find that or send me a code to do that ? Thanks in advance
[Deleted]
  Help with MT EA  (14   1 2)
windowfind works in mt4 build 1340, then in 1344, it gives always a +1 to its normal value, so now windowfin(name) must be windowfind(name)-1 to get back to the real value
In one of my EAs i'm calculating how long a trade is open (in seconds) I used it to test if order were open for longer than a week. In such case the inclusion of a weekend was no factor. As i'm now thinking of testing for shorter periods - 2 or 3 days - the weekend is a factor. On Monday noon, I'd
  MT4  (5)
Hello, when I asked for a emo account, it was for an Mt4 NOT Mt5, please may I have Mt4 demo
I have several watch lists I created in MT4 using the SET option. I wish to display these watch lists all at the same time. How can I do that? I tried opening more Market Watch windows and add a watchlist to each window but that doesn't work at all. I tried adding tabs to the existing Market Watch
Does someone know how to create an external windows from EA?? like these pictures:  For now i use objectcreate to create object in the chart. I want to put my trading tools in an external windows. but i don't know what kind of thing i need to do this.   Thank you in advance.      
[Deleted]
I am trying to develop an app which can launch MT 4 iPhone app. Can anyone let me know the URL scheme for iPhone/iPad apps to enable this? Thanks
I try to have in MT4 the same function has we have in MT5, but for some future (SP500) it does not work. The challenge is to calculate correctly the pip value : just using MarketInfo(Symbol(), MODE_TICKVALUE) does not work. any idea? Regards, OrderCalcProfit The function calculates the profit for...
class CPivotManager : public CObject  {   CObjVector<CPivotCandidate>_highPivots;   ...void CPivotManager::Tidy()  {   for(int i=0;i<_highPivots.Total();i++)     {      CPivotCandidate *candidate=_highPivots[i]; <-- Invalid pointer access?      if(candidate.GetIgnore() && candidate...