Connection Monitor with login action

Техническое задание

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.


Похожие заказы
attached is an nt8 indicator i would like modifications to. this will not be simple. once you review the indicator you will see it prints arrows and dots. the arrows print after the dots stop forming. i am using default settings, on the instrument es, using ninza renko 8:4 i want the arrow to be placed on the first dot. i do not want the arrow to just be backpainted into the past much like a swing indicator or
We are looking for an experienced TradingView / Technical Analysis expert who can suggest and build the best combination of indicators for a profitable and structured trading strategy. This is not about random indicator stacking. We need someone who understands market structure, confirmation logic, risk management, and strategy optimization. The goal is to create a clean, high-probability setup with minimal false
Indicator 100+ USD
Does anyone know what indicator this is on the image because I'm looking for something like this but just a bit more sensitive. Speaking about the diamonds all the rest is irrelevant
Hello . Hello I already have an indicator on TradingView written in Pine Script. I need some modifications and fixes for the existing indicator. The indicator sometimes gives wrong signals and I want to improve it. I will provide the Pine Script source code. The developer should check the code, fix the problems, and adjust the logic if needed
DO NOT RESPOND TO WORK WITH ANY AI. ( I CAN ALSO DO THAT ) NEED REAL DEVELOPING SKILL Hedge Add-On Rules for Existing EA Core Idea SL becomes hypothetical (virtual) for the initial basket and for the hedge basket . When price hits the virtual SL level , EA does not close the losing trades. Instead, EA opens one hedge basket in the opposite direction. Original basket direction Hedge basket direction (opposite) Inputs
Kindly see details below BUY ALERT 1. Supertrend turns Bullish 2. On this candle , or the last 10, BBStops is Bearish 3. On this candle , or the last 10, price was < or = MA1 4. Instrument is in trend (STEP MA1 and STEP MA 2 are both Bullish) 5. Distance in pips between Lowest price during last time BBstop was Bearish, and the value of Step MA 1 at last bearish candle of Step MA1
EA requirements and necessary correction to be done . The EA monitors the PROFIT of open positions and turns ON or OFF the ALGO TRADING accordingly. By PROFIT I mean the SUM of profit + commission + swap. The EA will have two strategies, the INITIAL and the SECONDARY. Each one of them will be selectable by the user in the EA inputs. Let me explain here how the EA will operate: 1. INITIAL strategy: ·
Hi I have a simple task (hopefully) I have a custom strategy that I built with the help of Claude Anthropic - everything is finished and I zipped it with power shell but when importing it NT8 gives me the error message that the file was made from an older, incompatible version or not a NinjaScript. My folder structure is correct as far I can see so I don't know what the issues is and it's costing me too much to go
Subject: Development of Ultra-High Precision Confluence Indicator - M1 Binary Options (Non-Repaint) ​ Hello, I am looking for a Senior MQL5 Developer to create a custom "Surgical Precision" indicator for MetaTrader 5, specifically optimized for 1-minute (M1) Binary Options trading. The system must integrate three distinct layers of algorithmic analysis. ​ 1. Core Logic: Triple-Layer Confluence ​The signal (Call/Put)
Hello, I have an MQ4 indicator that works with a specific strategy. I want to modify some aspects and convert the file to MQ5. It's simple and won't take much effort or time for someone experienced in this field. Ideally, the person undertaking this task should be familiar with the MX2Trading software, as I will be using it to transfer the signals from the indicator to the trading platform

Информация о проекте

Бюджет
50 - 150 USD
Сроки выполнения
от 1 до 20 дн.