Refinement of the existing trading strategy

MQL5 Experts MySQL

Termos de Referência

Good afternoon!

It is necessary to finalize the trading strategy below. Exactly: 

1) Refine the strategy for the automatic advisor of mql5 for metatrader. (Testing and usage - https://www.bybit.com/future-activity/ru-RU/mt4 )

2) rewrite the exit condition of the transaction:
When + 0.025 points are reached (in tradingview), the TP transaction is closed

3) With each new signal - opening a new order as in the strategy below (see code) Old deals are not closed - closing only on TP. There are no stop loss.

Timeframe: 5M

Money management:
Entry into the transaction: 5% of the deposit

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Gold_D_Roger
//note: spreading 1 statement over multiple lines needs 1 apce + 1 tab | multi line function is 1 tab
//Recommended tickers: SPY (D), QQQ (D) and big indexes, AAPL (4H)

//@version=5
strategy("Davin's 10/200MA Pullback on SPY Strategy v2.0",
     overlay=true,
     initial_capital=10000,
     default_qty_type=strategy.percent_of_equity,
     default_qty_value=10, // 10% of equity on each trade
     commission_type=strategy.commission.cash_per_contract, 
     commission_value=0.1) //Insert your broker's rate, IB is 0.005USD or tiered

//Best parameters
// SPY D
// Stop loss 0.15
// commission of 0.005 USD using Interactive brokers
// Exit on lower close 
// Buy more when x% down --> 14%
// DO NOT include stop condition using MA crossover

// Get User Input
i_ma1           = input.int(title="MA Length 1", defval=200, step=10, group="Strategy Parameters", tooltip="Long-term MA 200")
i_ma2           = input.int(title="MA Length 2", defval=10, step=10, group="Strategy Parameters", tooltip="Short-term MA 10")
i_ma3           = input.int(title="MA Length 3", defval=50, step=1, group="Strategy Parameters", tooltip="MA for crossover signals`")
i_stopPercent   = input.float(title="Stop Loss Percent", defval=0.15, step=0.01, group="Strategy Parameters", tooltip="Hard stop loss of 10%")
i_startTime     = input.time(title="Start filter", defval=timestamp("01 Jan 2013 13:30 +0000"), group="Time filter", tooltip="Start date and time to begin")
i_endTime       = input.time(title="End filter", defval=timestamp("01 Jan 2099 19:30 +0000"), group="Time filter", tooltip="End date and time to stop")
i_lowerClose    = input.bool(title="Exit on lower close", defval=true, group="Strategy Parameters", tooltip="Wait for lower close after above 10SMA before exiting") // optimise exit strat, boolean type creates tickbox type inputs
i_contrarianBuyTheDip = input.bool(title="Buy whenever more than x% drawdown", defval=true, group="Strategy Parameters", tooltip="Buy the dip! Whenever x% or more drawdown on SPY")
i_contrarianTrigger = input.int(title="Trigger % drop to buy the dip", defval=14, step=1, group="Strategy Parameters", tooltip="% drop to trigger contrarian Buy the Dip!") 
//14% to be best for SPY 1D
//20% best for AMZN 1D
i_stopByCrossover_MA2_3 = input.bool(title="Include stop condition using MA crossover", defval=false, group="Strategy Parameters", tooltip="Sell when crossover of MA2/1 happens")

// Get indicator values
ma1 = ta.sma(close,i_ma1) //param 1
ma2 = ta.sma(close,i_ma2) //param 2
ma3 = ta.sma(close,i_ma3) //param 3
ma_9 = ta.ema(close,9) //param 2
ma_20 = ta.ema(close,20) //param 3

// Check filter(s)
f_dateFilter = time >+ i_startTime and time <= i_endTime //make sure date entries are within acceptable range

// Highest price of the prev 52 days: https://www.tradingcode.net/tradingview/largest-maximum-value/#:~:text=()%20versus%20ta.-,highest(),max()%20and%20ta.
highest52 = ta.highest(high,52)
overall_change = ((highest52 - close[0]) / highest52) * 100

// Check buy/sell conditions
var float buyPrice = 0 //intialise buyPrice, this will change when we enter a trade ; float = decimal number data type 0.0
buyCondition  = (close > ma1 and close < ma2 and strategy.position_size == 0 and f_dateFilter) or (strategy.position_size == 0 and i_contrarianBuyTheDip==true and overall_change > i_contrarianTrigger and f_dateFilter) // higher than 200sma, lower than short term ma (pullback) + avoid pyramiding positions
sellCondition = close > ma2 and strategy.position_size > 0 and (not i_lowerClose or close < low[1])  //check if we already in trade + close above 10MA; 
// third condition: EITHER i_lowerClose not turned on OR closing price has to be < previous candle's LOW [1]

stopDistance  = strategy.position_size > 0 ? ((buyPrice - close)/close) : na // check if in trade > calc % drop dist from entry, if not na
stopPrice     = strategy.position_size > 0 ? (buyPrice - (buyPrice * i_stopPercent)) : na // calc SL price if in trade, if not, na
stopCondition = (strategy.position_size > 0 and stopDistance > i_stopPercent) or (strategy.position_size > 0 and (i_stopByCrossover_MA2_3==true and ma3 < ma1))


// Enter positions
if buyCondition 
    strategy.entry(id="Long", direction=strategy.long) //long only

    
if buyCondition[1] // if buyCondition is true prev candle
    buyPrice := open // entry price = current bar opening price

// Exit position
if sellCondition or stopCondition 
    strategy.close(id="Long", comment = "Exit" + (stopCondition ? "Stop loss=true" : "")) // if condition? "Value for true" : "value for false"
    buyPrice := na //reset buyPrice

// Plot
plot(buyPrice, color=color.lime, style=plot.style_linebr)
plot(stopPrice, color=color.red, style=plot.style_linebr, offset = -1)
plot(ma1, color=color.blue) //defval=200
plot(ma2, color=color.white) //defval=10
plot(ma3, color=color.yellow) // defval=50






Respondido

1
Desenvolvedor 1
Classificação
(574)
Projetos
945
47%
Arbitragem
309
58% / 27%
Expirado
125
13%
Livre
2
Desenvolvedor 2
Classificação
(3)
Projetos
1
0%
Arbitragem
5
0% / 100%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(39)
Projetos
52
19%
Arbitragem
15
27% / 67%
Expirado
8
15%
Livre
Publicou: 1 código
4
Desenvolvedor 4
Classificação
(296)
Projetos
475
40%
Arbitragem
105
40% / 24%
Expirado
80
17%
Ocupado
Publicou: 2 códigos
Pedidos semelhantes
Ищу стабильный торговый алгоритм для работы на счетах проп-компаний (типа FTMO). Требуется инструмент, полностью соответствующий правилам риск-менеджмента проп-фирм. Ключевые требования: * Обязательное наличие фиксированного Stop Loss для каждой сделки. * Категорический запрет на использование мартингейла, сеток и усреднений. * Жесткий контроль дневной просадки (не более 3-4% от баланса). * Стабильная работа на
Нужно разработать торгового советника для MetaTrader 5. Логика стратегии: работа на M1 (таймфрейм изменяемый) уровни Fibonacci задаются вручную (0 и 100) вход осуществляется в зоне 0–38.2 Fibonacci используется RSI BUY — RSI ≤ 30 SELL — RSI ≥ 70 дополнительный сигнал — пересечение RSI и его скользящей средней Функции управления позицией: Stop Loss за сигнальной свечой Break Even два типа Trailing Stop (обычный и
Основная идея советника заключается в использовании коррелирующих валютных пар для выравнивания отрицательного баланса. Изначально запускаются 4 пары, разделенные на 2 блока. В каждом блоке 2 пары, каждая из которых открыты разнонаправленно buy\sell с установленными заранее уровнями TP. Например: в одном блоке 2 пары EUR\USD buy и sell, во втором блоке 2 пары USD\CHF buy и sell. TP устанавливается в каждом блоке
Я ищу бизнес-партнёра с опытом в трейдинге и программировании, который сможет реализовать распознавание паттернов и на его основе создать прибыльного торгового робота (EA). Это профессиональная модель: автор заработал на ней миллионы, имеет подтверждённую историю результатов и хорошо известен в торговле фьючерсами
1. Общая концепция Советник предназначен для автоматического обнаружения ценовых волн, их визуализации с помощью инструмента «Сетка Фибоначчи» и циклической торговли на откатах. Основная особенность — мультиволновой режим: советник должен одновременно отслеживать и отрисовывать все движения, подходящие под фильтр размера. 2. Логика поиска и визуализации волн Динамическое натяжение: Советник сканирует рынок на глубину
Требуется создать советник на основе разворотных паттернов, используя дополнительные индикаторы такие как скользящее среднее, отклонение от скользящей средней, угол наклона скользящей средней. Возможно будет добавлено что то еще по ходу работы
к примеру 10 стратегий выстреливают одновременно в одну и ту же милисекунду при открытие бара надо их сделать последовательными один за другим, с проверкой, что предыдущий ордер был открыт и модифицирован SL TP оредра могут быть отложенные и маркет пока один ордер исполняется другие ждут в очереди так как используется ММ настоящий баланс double Total_Current_Risk() { double res = 0; for (int i = 0; i <

Informações sobre o projeto

Orçamento
30 - 150 USD
Prazo
de 3 para 21 dias