Connection Monitor with login action

MQL5 Indicators Scripts

Specification

Name: Paranoid Connection Monitor

Purpose: Prevent disconnections of terminal or long breaks in tick stream

Why: The terminal automatically attempts to login if it notices it is disconnected. The time before terminal find it self disconnected is depending on TCP/IP settings of the operating system. The time is long and a lot can happen.


This software would calculate the average tick interval and if tick is not received in a time depending on the average, it performs a login of the terminal (or rescan).


Challenges:

  • To my knowledge there is no function for login in MQL4. But the solution can be found here http://forum.mql4.com/15325#101492

  • Indicator start() function is called up on arrival of a new tick. Therefore an Indicator can not wait nor perform a task (e.g. login) if a tick does not arrive. I think this could be solved with a Script polling General Variables to which an Indicator writes.

System Description

The average tick interval is calculated over number of ticks (TicksInAverage) in the Indicator. The interval and time of the last tick (TimeOfLastTick) is then made available for the Script. To my restricted knowledge MQL4 does not support events triggered in Script from an Indicator. That would be better than my algorithm below which I use here for the sole purpose describing the function, not necessarily the code that I would like have.


User sets variables: TicksInAverage, TimeOutFactor


The initialisations are not addressed here.


AvgInterval() Returns latest value TicksInAverage in Indicator

TimeOfLastTick() Return latest value TimeOfLastTick in Indicator

SkipNextTick() Communicates to Indicator

TakeAction() It's a timeout. Take action. Function contain code both to do a login and rescan. The choice is made before compiling by turning one or the other section of code to comments (//).


Variable TimeLeft, TimeCpy

Loop { TimeLeft = AvgInterval() x TimeOutFactor - current time - TimeOfLastTick()

if TimeLeft<0

{ TimeCpy=TimeOfLastTick()

TakeAction()

SkipNextTick(TRUE)

whilst TimeCpy==TimeOfLastTick() {sleep(AvgInterval())}

}

else

{ sleep(TimeLeft)

}

}



The Indicator would have a function off:


AvgInterval() calculates average interval and communicates it to Script

TimeOfLastTick() communicates time of last tick to Script

SkipNextTick() communicate from Script if next tick should be skipped

Variables Interval

loop

{ Interval = tick time – TimeOfOldTick

TimeOfLastTick()

if FALSE==SkipNextTick()

{ AvgInterval(Interval)

}

TimeOfOldTick= tick time

}



Preliminary Requirements Specification

  • Name: Paranoid Connection Monitor

  • To work on windows 2003 and written in MQL4. Expert Advisor, Indicator and/or script

  • Risks to unsuccessful login or rescan shall be addressed by coder. E.g. Does simulated key strokes pose a risk and why. This Requirements Specification may be edited accordingly.

  • A login or rescan shall take place when average tick interval X a factor (TimeOutFactor) is exceeded. The initiation of login or rescan shall take place before average tick interval X (TimeOutFactor+1) provided enough CPU speed.

  • The average tick interval shall be calculated using a certain amount of ticks (TicksInAverage)

  • The average tick interval shall not take into account interval in between two ticks separated by a login or rescan

  • A log file shall be written (text or CSV) containing following information separated with Tab or “;” . Date, Login Start , average tick interval, Login end time. E.g.:

    19/02/2012 Interval 0.3 Start 19:03:32 End 19:03:47

    Login is considered completed / ended after first received tick

  • User can set varibales TimeOutFactor, TicksInAverage

  • A method of restarting the terminal in case of longer connection loss shall be described by coder and necessary tools provided. This may not have anything to do with the actual Paranoid Connection Monitor it self. But should be provided as extra guard.


Similar orders
1.Sinyal Perdagangan : Sinyal beli: garis MACD utama memotong garis sinyal ke atas (macd_current>signal_current && macd_previous<signal_previous). Sinyal jual: garis MACD utama memotong garis sinyal ke bawah (macd_current<signal_current && macd_previous>signal_previous). Gambar di bawah menunjukkan kasus beli dan jual. 2. Posisi ditutup pada sinyal yang berlawanan: Posisi beli ditutup pada sinyal jual, dan posisi
Indicator 30 - 300 USD
Hi guys looking for a reversal indicator that places signals in chart have a look at image attached but it's just for reference I'll be happy to hear new ideas and options. Signals must he placed at candle close amd not repaint. Since I'm offering a high budget and bringing a strategy is involved in the order I want everything to run smoothly in these steps 1. Send screenahots of it 2. I'll give you feedback what to
🔹 COMPLETE DEVELOPMENT ASSIGNMENT Institutional Volume & Structure Indicator Platform: MT5 (preferred) OR TradingView (Pine Script v5) Type: Indicator only (NO EA, NO auto trading) Purpose: Institutional analysis for manual trading & manual backtesting 1. GENERAL REQUIREMENTS Indicator only (no orders, no strategy execution) No repainting Auto update + auto remove logic Clean, modular, performance-safe code User
can anyone help me with building a complete automated pine code strategy and indicator that work for both FXs & CFDs and have a high winning rate proved through back testing. I have a very complex current code that developed mostly using AI but lots of gaps are there although it translate exactly what I have in my mind. So, you are free to decide whether wo build a complete new code or fix my current working code ( i
Two EAs 30 - 100 USD
Hello, I will need one indicator in Tradingview converted to a strategy in MT5. The indicator is called ...Multi Kernel Regression [ChartPrime] Indicator. If the indicator says "BUY" then the EA buys, if the indicator says "SELL" then the EA sells. I will need another one that is a strategy in Tradingview converted to a strategy in MT5. "UT Bot Strategy". Two in total. Lets talk
I have build the trade copier for ninja trader as indicator. I need someone to fix the issue i am having or create new one similar to replicanto. here are my issue.. ### 1. Opposing Positions Across Multiple Accounts A counter trade violation occurs when you hold opposite directional positions (Buy vs. Sell) in the same symbol or product across different accounts. * *Example from your report:* In Violation #8
Hello. I am finding an experienced python developer who can implement my trading strategies into robots. I like trend-following swing trading strategies and am going to automate my idea. More details can be discussed by chatting. If you have similar working experience it can be a plus. Thanks
Job Title MT5 Developer Needed – Sync Data Feed Between Two MT5 Accounts Job Description I am a trader using multiple MT5 accounts and need a reliable way to have the same market data from one MT5 account reflected in another MT5 account. One account already has a stable and accurate data feed, and I want the second MT5 account to receive identical pricing and symbols for analysis and execution purposes. What I Need
Greeting Im in need of a programmer that can help me convert from TOS to trading view? The script is available with me, kindly bid if it is what you can do for me Thanks
can you help me with I need an ATM strategy for NT8, here's the criteria: Forex trade entry 100,000 units with a starting SL of 70 pips. The following proft targets: 33 pips, 68, 125, 180. All targets exit 25,000 units each. As each target is hit, move SL to BE+5, then BE+35, then BE+70. So the SL's are fixed, not trailing. I can't figure this out on my platform

Project information

Budget
50 - 150 USD
Deadline
from 1 to 20 day(s)