Expert Advisors and Automated Trading - page 50

Hi Everybody, normally, I want to open only one Trade at the same time with my EA. It looks like this and works pretty fine && ( PositionsTotal ()== 0 ) But now I want to run the EA in different Charts with different values. Now I have to check if there is an open trade by Symbol. This was my idea
I could make a change in the code (lets say I alter the EA so that it will have a fixed SL of 25 points), then I recompile the script in the MetaEditor, and run it again in the strategy tester. It does not act on the changes I made in the code unless I compile the script under a new filename. Why is
Does anybody know, why the last three lines of the EVENT_MAP-section were colored red? It´t not colored, if I delete two random lines of "ON_EVENT". Not matter of the color, the defined events are working as expected. Any explanation would be nice. Thanks a lot for you time and help
So Recently i got the hitch of knowing how all the pips and points can be taken advantage of to make better trading decisions to maximize profit of course so... Just so you know i have low level of programming as i had done just basics of web dev, now i want to do more than just build websites.. I'm
So I am testing a code for sending orders based on two different StDiv BB. When I run the script it doesn't run on some markets. It shows a notification in Journal tab saying that the script has been removed. This happens only when my specific market conditions are met for the entries I've coded
// Input parameters input int AtrPeriod= 14 ; input int AdxPeriod= 14 ; input int MultipleStopLoss= 2 ; input double MultipleTakeProfit= 2.4 ; input int MagicNumber= 4 ; // Global variables int AtrHandle; int AdxHandle; bool FakeoutHigh; bool FakeoutLow; int OnInit () { //
Dear Guys I wrote a code below :   handle=FileOpen(File_Name,FILE_READ|FILE_CSV|FILE_ANSI);    if(handle==INVALID_HANDLE)  {   Alert("Cannot Read File Error : "+DoubleToString(GetLastError(),0));  }else{    while(!FileIsEnding(handle))    {      string text=FileReadString(handle);      }   } When i...
Hi every one i want to make table that shows trade time in a week for symbols. like the pic below. how should i use SymbolInfoSessionTrade to create it
Hello, I am new to coding and still learning C, since thats what they said I should learn first but I have something that I need to build. I am trying to build an EA that picks up buy trade after a consecutive number of bearish candle, the start of the count of the bearish candles starts after the
  cant share my EA  (15   1 2)
Hey I have build my own EA and trying to share it to a friend... i have complied it and sent him the EX5 but it keeps getting him this error... MQL5 your CPU architecture does not allow to run the file '....ex5': X64 required, you have AVX only what can i do to fix this
Hello all, I need to calculate the average value of some values inside a vector. Let me explain better: # 1 CopyBuffer (funz_RSI, 0 , 0 , 20 ,value_RSI) With the above declaration I have the vector value_RSI composed of 20 values. I want to calculate the average value with the first 10 value of
Hello, this is my code, it works well in the tester strategy, but when I put it in the main chart for real trades, it does not open a position. #include<Trade\Trade.mqh> CTrade trade; //+------------------------------------------------------------------+ //|
hi, i recently made a simple expert advisor, all i just want is to open, for example, a sell trade when a sell signal appears in the chart, that trade would be open until a buy signal appears, when the buy signal appears it would close the sell signal and immediately open a buy trade so on and so
[Deleted]
I want to fix first the; input bool isOneMin = true ; Once it is executing i can then code the rest of the conditions; input bool isFiveMin = false ; input bool isFifteenMin = false ; I am having an error balancing my parentheses and its cracking head. I am suspecting when i created this variable
So apparently in the new version of MetaEditor, there are options to compile different versions based on your CPU architecture. That's all well and good — I appreciate anything that boosts performance. But it's not working, and I can't find any information to help. I managed to find one thread in
// Define input parameters input int fastEMA = 20 ; // Fast Exponential Moving Average period input int slowSMA = 55 ; // Slow Simple Moving Average period input int macdFast = 10 ; // MACD Fast EMA period input int macdSlow = 50 ; // MACD
The Expert advisor I’m developing trades Nasdaq index futures using the 150 day moving average for trading decisions. I have to use the generic @ENQ constant series to calculate the 150 day moving average because the current spot futures contract doesn’t have 150 days of history when it becomes the
void OpenTrade() { MqlTradeRequest Traderequest; MqlTradeResult Traderesult; ZeroMemory (Traderequest); Traderequest.action = TRADE_ACTION_DEAL ; Traderequest.type = ORDER_TYPE_BUY ; Traderequest.symbol = _Symbol ; Traderequest.volume = 0.01 ; Traderequest.type_filling = ORDER_FILLING_FOK ;
I wrote an expert that saves the information of my trades in a text file every few seconds. It works fine in the first few hours, but after a while it gives error 5004. My code: //+------------------------------------------------------------------+ //|
I have been using cloud network for over a year and have not experienced this before. I optimize my EA, on (15-17) assets every week and have been doing so since January. Last night, when I started my optimizations, the times were in the hours not minutes, checked the cloud agents and it was only
Hello Everyone ,, I need a little help I have calculations are shown on the chart but by a robot not as indicator , as comment , I want to make a comment on a blank indicator just to show my variables calculations with updated seconds interval, I tried but couldnt , Any help is appreciated, the
Im trying to make an EA as im learning to be able to place a trade on a 30s MA cross. I can make an EA that can trade based on MA crosses but the second time frame is super confusing. im a scalper so the 30s timeframe is great and i use tradingview, but i was wondering if there was a way to make an
Hi all, I am trying to optimize my EA with with different timeframes as input. Here is how I change the TF within the code, where Timeframe is the input: int OnInit (){ ChartSetSymbolPeriod ( 0 , NULL , Timeframe); ... Then in my code I simply use Timeframe wherever I need it (just in iCustom
Hi, I want to store a position ticket in result of stop order has been filled. I already store the order ticket when opening stop order and when the order is filled I want to update the stored ticket to a position ticket. If I loop all the position and find the position for that symbol and that
Hello everyone, I'm encountering a peculiar issue with adjusting my Stop Loss in a trailing manner and am hoping someone can shed some light on this for me. Below is the function I use for trailing the Stop Loss: void CPM::TrailingStopLoss( string pSymbol, ulong pMagic, int pTSLFixedPoints) {
Dear all, I am new to trading and am developing my first strategies in MQL5. Up to now, I am only testing different strategies in Strategy Tester. Whenever I open a position, I am essentially buying, I only "go long", because "going short" is still a bit nebulous in my mind. Imagine I start with
Hello friends Please I'm trying to make my gui buttons work on MT5 backtest Below is the code I used Please help. Thanks long lparam = 0 ; double dparam = 0.0; string sparam = ""; sparam = "btnLines"; if( bool( ObjectGetInteger( 0, sparam, OBJPROP_STATE ) ) ) OnChartEvent(
  Compile  (3)
I needed to compile a script first and then a robot I give you the coded script Automatic translation applied by moderator
Hello. How do you know there is a deal already executing on a position so you do not request another deal on that position? (I am running a partial close on a position and I do not want to run another) Thanks