Expert Advisors and Automated Trading - page 81

Dear experts, I have BUTTON and LABEL Objects on my chart and I want to delete all these chart objects during the removal of EA from Chart. I tried both of these in Deinit() and they did not work: void Deinit( const int reason) { StopTimer(); if (reason == 1 ) { ObjectsDeleteAll ( 0 );};
So I want a series of conditions to come true before I enter a trade. I tried to build multiple ifs inside on tick but it doesn't suit to my needs. I don't want all of my conditions to come true to the same tick. I just want them to come true the one after the other. For example if condition 1 is
Hi How to make SimplePanel1 and SimplePanel1 indicator on the main chart window and on the subwindow //+------------------------------------------------------------------+ //| SimplePanel.mq4 | //| Copyright 2009-2014, MetaQuotes
Hello people Can someone help me with the following error that the system is throwing when I run my robot? Error of server. Metatrader 5 is not receiving data from "broker name"
Hello, I'm making a post because I can't find an answer to my question: I'm looking to calculate the P&L of past or current trades for different types of traded assets. Context: I am developing my algorithmic trading framework. Currently I can retrieve data from different platforms and place trades
  PositionsTotal()  (13   1 2)
How should I use PositionsTotal() to return the number of operations at the symbol (chart) applied and not the total? (MQL5 code) For several reasons I need you to be as well. I don't want the total, as I do not wish to take into account manual trades in other symbols. Thank you in advance.‌ int...
[Deleted]
When computing the Stop Loss what do you prefer? I mainly use ATR
Dear all, Build 2815, MQL5 Hello and I hope this post finds you all well. It seems that when my EA runs at the strategy tester it cannot access data that are sufficiently old. In particular, it loads data that are maximum one year old from the date that I wish to start running the EA but not older
if(samples[i].outcomes[ix_of_class]== 1.0) this is not safe to use right ? i mean it can spit out 0.9999999999999 or something and it will not pass the check
Migration to virtual hosting failed: DLLs are not allowed. expert advisory uses Kernel32.ddl, please remove the expert from your charts and migrate again. Never had this problem before. Can anybody help
I had my account temporarily suspended because my bot made too many server attempts. It checks "ontick" to see if the position needs to have the stop loss moved and then sends a modification order if appropriate. The key here is that "ontick" is too often. I was doing some reading and discovered
im constantly getting the bytes not available , 0 heapmin result error. can someone tell me what am i doing wrong and how to correct it please
Hey gang, I want to register more than one VPS so that I can run separate EAs and not have them conflict with each other. Does anyone know if that is a possibility? I don't appear to have the option of registering another VPS, neither on an account already using a VPS, nor on another account for
Hey, my EA creates double orders, when is synced with vps, so my question is, should I close mt5 or disable trading after syncing all with VPS
I want to make a trail system that will only do trail once or for a specified number of times. Can you guide me how to do this
Guys please take a look at this. This line of code is supposed to count all the positions and return the number of open positions... It does so perfectly. But then I added, if the number of positions is > 5 then don't open positions stt = 5 The problem is that it just goes ahead to open multiple
Are SYMBOL_VOLUME_STEP and SYMBOL_VOLUME_MIN ever different? I have never seen an instrument where the minimum volume wasn't the same as the volume step value. Did you ever see an example where it wasn't the same? Do you think it's possible even though you might have never seen it
Dear experts, How can I position my BUTTON object dynamically on chart in a way that when chart size changes or MT5 window is resized I can still see the buttons at the left most side of my chart (st like like Aligned left compared to chart window). I create my BUTTON object with below code now and
the code above erects this help box but when something is passed to it it throws an error. Just curious to what its supposed to do void print_type( void *& params[]){ } int OnInit () { //--- int h[]={ 1 , 2 , 3 }; print_type(); //--- return ( INIT_SUCCEEDED ); }
I feel weird asking this question.. but somehow I have an EA (Mt5) which seems to 'lose' trades. I've been trying to find a problem for the last few days and not getting any nearer. It's almost as if there is an EA deleting trades! I created the small routine below which just checks the positions I
#include <Trade\Trade.mqh> CTrade trade; input int TrailingPoints = 1000 ; input int TslTriggerPoints = 2000 ; int OnInit () { return ( INIT_SUCCEEDED ); } void OnDeinit ( const int reason) { } void OnTick () { double Ask= NormalizeDouble ( SymbolInfoDouble ( _Symbol , SYMBOL_ASK
A short overview: This issue was reported on "Metatrader Questions and Answers" end of November 2022. This is the original description, I posted back then: " Alexey, I have found a very strange behaviour concerning the compilers optimization. I hope you can give some insigt to this, as it is to my
Code explains it : #define NAMEOF(x) #x template < typename X> string findName(X &value){ return (NAMEOF(value)); } int OnInit () { //--- int macaroni= 0 ; string name=findName(macaroni); Print (name); //--- return(INIT_SUCCEEDED); } i expected that i'd get "value" can i get "macaroni" ? tx
Hi guys, i have created this strategy which is executing one trade a day, the idea here is to buy when the overall trend is bullish and sell when the overall trend is bearish. The issue is, that the bot aint buying, its only selling.... its also selling when the trend is bullish. I tried a lot but
I'm creating basic EA, using SAR. The problem is when the direction of SAR changes i get strange values of SAR. Working of advisor: When SAR changes its direction, it detects whether it goes up or down, and open trade. int OnInit() { . . . sarHandle = iSAR(_Symbol,PERIOD_M1,0.02,0.2); . . . } void
Hi everyone! I would like to know if it is possible using the library ( user32.dll ) to be able to make market entries by making the Expert press the Buy/Sell in the graph window, as shown in the image. Instead of doing an OrderSend() within the code to have it press the Buy or Sell in "One CLick
hello , i have this fuction to grow an array and return its latest element for immediate access : //expand primitive array template < typename X> int expand_primitive_array(X &array[]){ ArrayResize (array, ArraySize (array)+ 1 , 0 ); return ( ArraySize (array)- 1 ); } template < typename X> int
I rather quickly stumbled across a misconception that I have ignored for a while now, it is finally time to address it. My EA currently fires in a bunch of orders to scale in and out of trades, the problem is: I thought if I have i.e. 3 BUY orders open and I want to close one, I could simply place a
  expert stoploss  (2)
I want to write an expert that, when I set a specific price, whenever the market price reaches it, my positions will be closed (exactly similar to stop loss, with the difference that in stop loss, the set price is recorded in my broker, But in the expert, I want only this price to be determined in
  Martingale ea  (4)
Please I need to edit this ea by the following features Take profit points double the stoploss, start and close time to be added, option to choose the first trade to be manual or auto Also I have a problem when I manually close a trade the ae automatically open a doubled reverse trade