MQL4 and MetaTrader 4 - page 1572

[Deleted]
this will not execute a buy ??? #include <stdlib.mqh>#include <WinUser32.mqh> int start(){ int ticket;if(MessageBox("Buy 0.01 "+Symbol()+" ?",              "Script",MB_YESNO|MB_ICONQUESTION)!=IDYES) return(1);ticket = OrderSend(Symbol(),OP_BUY,0.01,Ask,3,0,0,NULL,0,0,Green);if(ticket<1)  {   int...
Greetings, This is my first post and I want to thank you very much for creating MetaTrader and making it available for free!(?) I have a couple of questions that I will post as separate threads but I have a couple of questions that fit in this thread. 1. Why is MT free? 2. How long will it be free?...
[Deleted]
Hi, everyone, Another newbie here :) I've been trying to write an ea based on the data, provided by an indicator, again written by me. Of course I can always add the same code that I've used in the indicator in the ea as well, but I'm really hoping there's a better way. I've seen functions that use...
[Deleted]
Hi, Dear Coders. This is StepMA. Only one MA in the code. Can anyone of you help to change the code, to write 8 stepMA in this indicator, please. I would like to have 8 stepMA in one indictator. //+------------------------------------------------------------------+ //|...
New article Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization (Cont.) is published: In this article the author continues to analyze implementationalgorithms of simplest trading systems and describes some relevantdetails of using optimization results. The...
I wrote the following to close orders. Actually I set two different situations to close long positions. The structure is as follows: for ( int i = 0 ; i < OrdersTotal () ; i ++ ) { if ( OrderSelect ( i , SELECT_BY_POS , MODE_TRADES ) == false ) break ; if ( OrderType () == OP_BUY ) if ( ******* )
Hello Community! My question is: what's the difference between running an EA in a productive environment compared to a simulated environment such as the strategy tester? I'm thinking of aspects like - quality of modeled environments (data quality for instance) - availability (hardware, power,...
[Deleted]
Hey there everyone! It's been almost a year since I posted needing help. I've been able to figure everything out thus far. However- This time I've been stumped on what to do. for(cnt = OrdersTotal(); cnt >= 0; cnt--)     {      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);         mode =...
Hey my fellow traders, does anybody have a script which can open short and long positions at one time and I can define stop losses and take profits in it? I mean instant execution. I was trying to make a script like that but, Im not really "programmer" and it didn't work well. Sometimes it just...
[Deleted]
please i like to know what will happen if i open an order manually,with take profit, stop loss,and trailing stop, and i decide to attach an ea that has the same instruction to the chart after opening the trade,will the ea continue to manage the opened trade or ignore it and open its own.thanks in...
[Deleted]
I have an ma cross indicator I am trying to get to send me emails when they cross up or down, the problem is I get tons of emails like at every tick it seams after the cross. Does anyone have any idea what I am doing wrong and how to correct the problem. Thank you in advance. property...
[Deleted]
How do you write a code to increase the trading lot size by every (full)  $1000 gain in account balance and the lot size should not round up ? eg Balance   lot size $1000     0.01 $1450     0.01 $2000     0.02 $2990     0.02 $3100     0.03
[Deleted]
I found in many backtests that orders opened with defined TP not always close when the TP arrives. Is it some kind of known bug? Am I missing something? I'm attaching part of a report I've got which demonstrates it quite well. In the report, order no. 7 should have been closed when order no. 9 was...
[Deleted]
I am having a tough time firguring out how to apply the Stochastic on top of AC indicator in Meta Trader 4. Can someone help me please? Thank you!
I would like to start a discussion on the optimizationoptions that are currently available in MT4 (not the actual implementation ofthe GA used for optimization, which should be a topic for MT5). In its current version MT4 has 3 “models”: 1) Every tick (claims to be the most precise...
[Deleted]
When restarting the previous charts and templates are applied. Sometimes a chart leads to hanging, and I would like to find the .ini file, or .TXT file and manually delete just one of the charts from the file. That way I could restart without error. Where is the file/entries to do this manual...
[Deleted]
Hi, I wonder if anyone can help me. I'm new to MQL4 and don't really understand it. But, what I have found is that the ADX (and DI's) calculations appear to be very different from Wilders original formula and the results are also very different from other trading platforms . I've looked at the code
[Deleted]
Hello, I´m looking for an EA, who would me helps and programs this: at first: - it can always only 1 (one) order be open - trading on chart "Symbol ()" - timeframe used on the chart - LOT = 1.0 (should be variable) furthermore: - OP_BUY: - if ((MacdPrevious < SignalPrevious) && (MacdCurrent >...
[Deleted]
Is it possible to run tester automatically from MQL script with parameters specified in script like: data, type of currency, period, name od EA and type of modelling? Best Regards
Hello - for whatever reason I'm back at square one again as my stderror.mqh should not be my old original one with mods to get over the >31ch bug in that file. but the damn thing is there and no where or if there is 'proper' one with <=31ch lengths... whatever.... PLEASE could anyone reply to this...
Hi there, I tested 'macd sample'.. the default one.. and i added one line "Print("Close MacdCurrent "+MacdCurrent+" MacdPre "+ MacdPrevious)", just to see the macdCurrent.. and i have 2 values from this line, the first one its 0.074 on chart and the second one in the journal its 0.070 !? What...
[Deleted]
Hello, can anyone point me out how the ideal way to POST/RETRIEVE data to database in a web server. i can code php and back end is ready as soon as there's way to send/get data through metatrader 4 terminal. Any idea ?
How Do Call or using Another Script in my mql4. example main mql4 names is deneme if a>173 l "closeAllProfitOrders"
[Deleted]
Hi, This is a general question about MQL4 API and terminal design i havent found answers on the forum or knowledgebase. When EA is running it is exposed to tick-level events. But what happens when there's a network outage, lets say for 20 seconds my terminal doesnt receive any ticks. 1) When the...
[Deleted]
  Closing a trade  (7)
OK, so this is so simple I can't beleive I actually have to post a thread about it, and I apologize.  However, I have searched through all the documentation and all I have found is info on how to close ORDERS, not actual OPEN TRADES.  So I need to know, how can I close a trade, or a portion of a...
[Deleted]
Is it possible to seperate the bid and ask data feed and chart them both ?
[Deleted]
Hello I have set up a different copy of metatrader with historical alpari data -- this copy never connects to a server in order to preserve my historical data. However, I would like to run backtests with different spreads and stop_levels from the ones used by the last account that i used with this...
I designed my EA based on the M5 chart. I'd like to set the close price of bar[2] of the M15 CHART as the stoploss price when opening a position. How can I quote the price? Thanks!
[Deleted]
Hi,could you help me translate a Metastock indicator to metatrader ? Here's the code : Period:= 15;denom1:= If(HHV(H,Period)-LLV(L,Period)>0, HHV(H,Period)-LLV(L,Period), 1);P1:= Mov(((C-LLV(L,Period))/ denom1)*100,3,E);denom2 := If(HHV(P1,Period)-LLV(P1,Period)>0, HHV(P1,Period)-LLV(P1,Period),...
[Deleted]
I'm learning mq4 and have one that displays 2 ima's. But they are bothdrawn in read. How can I control the colors and thickness of theselines? I'm computing the 2 ima's in the start() function. thanks, William