MQL4 and MetaTrader 4 - page 71

To post a new topic, please log in or register
The book says: The example below closes all sell orders currently opened by an expert advisor: I think I understand most of this code, but the: OrdersTotal() - 1 I don't get. Why - 1? Thanks. for(int order = 0; order <= OrdersTotal() - 1; order++){  bool selected = OrderSelect(order,...
Hello, Im having some trouble building trend lines around a RSI indicator - what seems to be the problem is the "time" coordinate for setting  lines. The result is :    This is the first time i build such indicator ! Hope you can help ! The code is below :    int limit;   int...
ello all, First of all both EA and Indi is not mine got it from internet. Need EA expert to modify the EA to open the order based on in RSI arrow, eg : if 1st arrow "up" open buy if TP not hit then open another buy at 2nd arrow and still not hit open buy at 3rd arrow and continue.. until max order...
Please help guys. Why all EAs stopped working on this latest MT4? Anything to do or convert inside EAs? Or any latest compiler? Please help
Hi, Mi EA works opening one Sell and one Buy orders at the same time, and when one of those are closed by TP or SL then it opens another Sell and Buy orders. What i want to do is avoid EA to open an order if same is already openned. I attach the EA for you to help, im really new on this. THANKS!!!
Hi all, Because  i use a lot of small lotsizes 0.01 (martingale) i need a indicator that show my open positions in lotsize. Can somebody help me with that? I already found this code below: //+------------------------------------------------------------------+...
i recently bought an indicator <product name removed> and it was working fine for a few weeks. Then right after a windows update it wouldn't load the indicator anymore in met4. I've deleted the indicator from met4 and tried to download it again but its not downloading it. Any ideas?
Guys: I use the optimization in the tester to do some reserch of my stargegy. I set one parameter to vary from 0.1 to 2.0, so there should be 20 results. But the testor only show 11 of them, which is profitable. or "significant"...... How can i see the other 9??? By the way, simplely lable...
I created a basic EA - buy the up bar. Loaded it, compiled, and clicked Optimize. The Expert Properties Inputs were Value 5.0; Start 5.0; Step 5.0; Stop 100.0 AUDUSD H1; spread 10 Period selected was previous 12 months. Without the Optimization I should have seen profits, except I have negative net...
I need a developer to create a position sizer for my traders. It should work as it works on website regarding calculations but it has to work on chart by moving a line on chart
int totalorder(int m){   int total=0;   for(int i=0; i<OrdersTotal(); i++)   {      if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))continue;      if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=MagicNumber || OrderType()!= m) continue;      total++;   }   return(total);}double open(int m){   for (i...
Hi All, I am currently try to se Brief desciption of the issue:  - I have a grid of orders. Each orders has its own Take Profit and Stop Loss level. - I want all orders (active or pending) of the grid to be closed or deleted when the price reaches a certain % difference from the price at which is...
Hi guys, I have problem in my code and I can't find the solution. description of my code is:      1 - use auto lot size: Auto Lot Size = NormalizeDouble(AccountBalance() * Risk / 100 * AccountLeverage() / contract, LotDigits); first order on entire history : use Auto Lot Size if order...
HI guys, I can display the default fib on charts no problem but if I want a custom set of levels I run into problems. I read the documentation here https://docs.mql4.com/constants/objectconstants/enum_object/obj_fibo which shows the code but doesn't actually use it in the example! Can anybody offer...
Hi, can someone help me create this new EA? It works with 3 supertrend indicators (you can find it here Free download of the &#39;SuperTrend&#39; indicator by &#39;jnrtrading1&#39; for MetaTrader 4 in the MQL5 Code Base). They should avoid trading range operations. the settings are 10,3 7,3 and 10,2...
Hi all, Starting to play around with custom indicators more and I've hit a roadblock with the divide issue. I'm calculating the spread difference between a synthetic price and its underlying (dividing the close price of 2 pairs less the underlying currency pair) which is then displayed as a moving...
Regarding indicators and time frames in the code. https://www.mql5.com/en/docs/constants/chartconstants/enum_timeframes EI: imomentum https://www.mql5.com/en/docs/indicators/imomentum Question: Where noted and regarding the time frames. What is expected to happen when you select a static...
Hi. I want to build a Basic Parabolic SAR EA and after I write the code and start a backtest, it doesn't work the way it should, or better to say the way i want it to do. Well i want to open a new trade at the reverse point and also close the last trade too. here's my code: void OnTick()  {...
When publishing a product it is not allowed to attach any external file with it as i know...but if my product in need of some audio and bitmap images files then how to publish it??
Please can somebody help me go through this code and find out why its having multiple entry, if a sell condition is true it keeps entering multiple sells, the same with buy...
  pending order modify (14   1 2)
Hey guys, I have a problem with my pending order modify. Has anyone of you an idea? When I add this to a chart there is no modifying taking place and no error message given out. Whats wrong here? Cheers Fabian {RefreshRates();double ppoint=MarketInfo(OrderSymbol(), MODE_POINT); int...
Hi guys, pretty difficult to explain in a headline. I have this function: double ClosePrice(string symbol, int timeframe, int position) {   return   iClose(symbol, timeframe, position);} And I call this function like this: double price = ClosePrice("EURUSD", PERIOD_H1, 10); Now I want to define the...
Hi guys, Any one can fix this FR-ReversalPoints Indicator, Reversal Dots appears after some candles formed.  please fix it.
I am just starting to learn coding. So, I tried modify a code I found on FF site, I am stuck - I don't know how to get this done smoothly. I actually wanted the EA to always use total lotsize of loosing trade to open the next trade. For example, if there are 0.01, 0.02, 0.03, 0.04 lots of four...
How to detect NEW Bar?  I want to reset my indicator variables if there's a new bar.  I'm thinking to use the volumes data to detect it but I don't know if that's right formula or best code to do it??
Hi, I want to display horizontal and trend lines description on chart, is it can be done ?
I was testing my EA with the build in Strategy Tester from MetaTreader 4. I recognized that my EA placed far too few orders because of missed trend signs. After checking the chart by my own, I realized that my EA processed the Tenken-sen wrong. Therefore I printed the retrieved Tenken-sen values...
Ok so I grabbed this code from another post on this forum, which works great for closing multiple open trades based on FIFO rules. However when there is just 1 open trade to close, it's not closing. What do I need to change to fix this but not break the FIFO capability? void CloseOrders(int slippage...
Hi All, back again to nag you. :-) Would anyone have a handy-dandy little MQL4 function that automatically calculates lot size (for any symbol) based on how much % risk of my available equity, and my desired stoploss size in pips? Thanks! Shawn
Hello Developers, I need your help to solve a peculiar case. My problem happens when sending TP and SL for orders. EA seeks TP of only 10 points. However when opening orders this distance is not being respected. For example, if I open a buy order by placing a 10-point...