Standard deviation of returns on EA and indicator made

MQL4 지표 전문가

작업 종료됨

실행 시간 1 일

명시

Rewrite code of the STD (of symbol) in the indicator and EA for the spread formula with the STD of returns instead


Input parameters

Symbol A

Symbol B

Sign of beta (1 for positive value and -1 for negative value)

Enter positions threshold

Exit positions threshold

Symbol A Lots

Symbol B Lots

Maximum loss in account currency

Maximum profit in account currency

Period for returns

Period of STD

Stoploss A (in pips)

Stoploss B (in pips)

The algorithm

Making a Robot on JForex which can take positions on several pairs trading at a time or one robot per pairs trading.

All calculations and trades take place at bar opening (when the first tick of new bar occurs at any symbol) and only close prices are used in calculations.

1. Calculate the returns of both symbols:

Return = (P – Pt) / Pt

 

P – close price of previous bar,

Pt – close price Period for returns bars ago.

 

2. Calculate standard deviations of “Close” prices for Period of STD bars for both symbols.

 

3. Calculate the spread using the following formula:

Spread = Return(Symbol A) / STD(Return(Symbol A)) - Return(Symbol B) / STD(Return(Symbol B))

4. Trading.

 

If the beta is positive:

 

If the spread amount at previous bar reaches Enter positions threshold (positive), send SELL market order for Symbol A and BUY market order for Symbol B.

 

If the spread amount at previous bar reaches minus Enter positions threshold (negative), send BUY market order for Symbol A and SELL market order for Symbol B.

 

If the beta is negative:

If the spread amount at previous bar reaches Enter positions threshold (positive), send BUY market order for Symbol A and BUY market order for Symbol B.

If the spread amount at previous bar reaches minus Enter positions threshold (negative), send SELL market order for Symbol A and SELL market order for Symbol B.

 

5. The EA should close both positions in one of the following cases:

                - total result of the positions reaches Maximum loss in account currency;

                - total result of the positions reaches Maximum profit in account currency;

                - the spread value at previous bar decreases to Exit positions threshold (in absolute value).

6.  Open a position for each crossing of a threshold, even if a position was opened before.

7. The EA will have to find all open positions, sort them by pairs, check whether a position in each pair is closed by stop-loss or not, if so - close another position of the pair...

8. Calculating the profit or loss for a pairs trading position independently for each position. If the trading account don't have enough marging, don't take the position, and put a message on the message box on the trading platform.

 

응답함

1
개발자 1
등급
(187)
프로젝트
367
56%
중재
45
22% / 56%
기한 초과
188
51%
무료
게재됨: 1 기고글, 6 코드
2
개발자 2
등급
(128)
프로젝트
206
49%
중재
29
28% / 48%
기한 초과
33
16%
무료
게재됨: 1 코드
3
개발자 3
등급
(34)
프로젝트
80
34%
중재
13
31% / 54%
기한 초과
19
24%
무료
4
개발자 4
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
5
개발자 5
등급
프로젝트
0
0%
중재
2
0% / 100%
기한 초과
0
무료
비슷한 주문
The Advisor should stop trading if the spread exceeds a selected value. Source code is unavailable. Decompilation may be necessary or any other suggested working solution may be acceptable. Testing should be thorough with proven demonstrable results
Convert Time Range Breakout Indicator to Strategy (Pine Script) I have an existing Time Range Breakout indicator on TradingView. I need a developer to convert it into a fully functional strategy with proper trade execution logic. Strategy Logic: Time Range: Define a specific time range (e.g., 03:00 – 04:30) During this time, the indicator marks the High and Low range Entry Conditions Buy when price touches the range
Hello, I’m looking for an experienced MQL4 developer to build a custom MT4 Expert Advisor based on a Koncorde-style indicator strategy. Here are the main requirements: 🔹 General Overview The EA must be a master EA , running on a single chart and managing multiple currency pairs simultaneously No need to attach EA to each chart Must support a configurable list of symbols 🔹 Indicator Requirement Develop a custom
I want to find a Developer to perform this work and settle payments in this Application. I undertake not to communicate with Applicants anywhere else except this Application, including third-party
Hi guys I’m looking for a coder who’s experienced in one script. The candidate must be familiar with fractals and self similarity. If you can’t code self similarity, please don’t bother contacting me ( respectfully). I just don’t want us to waste each others time. My budget is 100$. If that’s too low for you please, don’t contact me. Only contact me if you can code self similarity and can accept 100$. I will provide
I hope to acquire a profitable and existing expert advisor (EA) from the gold market, with complete source code, to add to our client portfolio. you can WECHAT: Faca7898 Please note EA when adding friends. It should be clarified that this does not require you to formulate or design new strategies. If you already have a verified, consistent, and production-ready EA, I am willing to purchase it immediately and engage
Core Requirements: Platform: MetaTrader 5 (MT5). Symbol: XAUUSD (Gold). Timeframes: M1 and M5 (user selectable). Trading Style: Scalping with controlled risk (not aggressive or high-risk strategies) -> adjustable, even better. Execution: Fast execution, optimized for gold market conditions. Frequence = adjustable, but there should be 10-20 trades per day. Strategy Logic: Use a reliable and conservative strategy
Eu preciso disso. A linha central do TMA (17,5,1.5) será a principal referência. Outra linha de média móvel (AVG) de 3 períodos decrescentes 2. As ordens serão as seguintes: abaixo, somente compra de TMA; acima, somente venda de TMA. O sinal de entrada será o seguinte: se o preço estiver acima da Média Móvel Tarifária (TMA), será apenas para venda; quando o preço se mantiver abaixo da Média Móvel Tarifária (AVG)
I am looking for non-repainting indicator to run in all sessions for scalping gold , happy to discuss if you have developed such indicators which can show profit and stop loss levels
Hello! I want to buy two indicators: A Support and Resistence Indicator and a Trendline Indicator. Support and Resistence Indicators needs to automatically draws Support and Resistance lines based on High and Low Candle in every time-frame (If possible time-frame needs to be in inputs and choose by me what time-frame i want indicator to draw lines) Trendline Indicator needs to automatically draws Trendline Channels

프로젝트 정보

예산
10 USD
기한
에서 1  2 일