Техническое задание
//@version=5
strategy("Operator Psychology Trading Strategy with Heikin-Ashi (Auto Risk-Reward)", overlay=true, pyramiding=2, default_qty_type=strategy.fixed, default_qty_value=1)
// Check for the 3-minute timeframe
if (not (timeframe.isintraday and timeframe.period == "3"))
runtime.error("This strategy can only be run on the 3-minute timeframe.")
// Parameters for ATR, Stop-Loss, Risk Percentage, and Sideways Market Threshold
atrLength = input.int(3, title="ATR Length") // ATR length set to 3
riskMultiplier = input.float(3, title="Risk Multiplier for Stop-Loss") // Updated Risk Multiplier to 3
capitalRiskPercent = input.float(2, title="Capital Risk Percentage per Trade", minval=0.1, maxval=100) // Capital Risk set to 2%
sidewaysThreshold = input.float(1.6, title="Sideways ATR Threshold", minval=0.1) // Updated Sideways ATR Threshold to 1.6
// Moving Average for Trend Detection
maLength = input.int(6, title="Moving Average Length") // Updated Moving Average length to 6
ma = ta.sma(close, maLength)
// Heikin-Ashi Candle Calculation
haClose = (open + high + low + close) / 4
var haOpen = (open + close) / 2
haOpen := na(haOpen[1]) ? (open + close) / 2 : (haOpen[1] + haClose[1]) / 2
haHigh = math.max(high, math.max(haOpen, haClose))
haLow = math.min(low, math.min(haOpen, haClose))
// Calculate ATR based on Heikin-Ashi candles
atrValue = ta.atr(atrLength)
// Define the previous and current Heikin-Ashi candle values
prevHaClose = haClose[1]
prevHaHigh = haHigh[1]
prevHaLow = haLow[1]
prevHaOpen = haOpen[1]
currHaClose = haClose
currHaHigh = haHigh
currHaLow = haLow
currHaOpen = haOpen
// Calculate buy and sell volumes using Heikin-Ashi candles
prevBuyVolume = prevHaClose > prevHaOpen ? volume : 0
currBuyVolume = currHaClose > currHaOpen ? volume : 0
prevSellVolume = prevHaClose < prevHaOpen ? volume : 0
currSellVolume = currHaClose < currHaOpen ? volume : 0
// Sideways Market Condition: Check if ATR is below threshold (low volatility)
sidewaysMarket = atrValue < sidewaysThreshold
// Define Buy Signal conditions based on operator psychology using Heikin-Ashi candles and trend confirmation
buyCondition1 = currHaClose > prevHaHigh // Heikin-Ashi close breaks previous Heikin-Ashi high
buyCondition2 = currBuyVolume > prevBuyVolume // Current buying volume exceeds previous
buyCondition3 = prevHaClose < currHaOpen // Previous Heikin-Ashi candle closes lower than current open
buyCondition4 = haClose > ma // Close price is above moving average (trend confirmation)
buySignal = buyCondition1 and buyCondition2 and buyCondition3 and buyCondition4 and not sidewaysMarket // Avoid sideways zones
// Define Sell Signal conditions based on operator psychology using Heikin-Ashi candles and trend confirmation
sellCondition1 = currHaClose < prevHaLow // Heikin-Ashi close breaks previous Heikin-Ashi low
sellCondition2 = currSellVolume > prevSellVolume // Current selling volume exceeds previous
sellCondition3 = prevHaClose > currHaOpen // Previous Heikin-Ashi candle closes higher than current open
sellCondition4 = haClose < ma // Close price is below moving average (trend confirmation)
sellSignal = sellCondition1 and sellCondition2 and sellCondition3 and sellCondition4 and not sidewaysMarket // Avoid sideways zones
// Calculate Stop-Loss and Target Levels for Long and Short Positions
longStopLoss = currHaClose - (atrValue * riskMultiplier) // Stop-loss for long position
shortStopLoss = currHaClose + (atrValue * riskMultiplier) // Stop-loss for short position
// **Auto Risk-Reward Ratio**: The Reward (Target) is dynamically calculated based on the risk
rewardRatio = input.float(6, title="Default Risk-Reward Ratio") // Updated Risk-Reward Ratio to 6
longTarget = currHaClose + (currHaClose - longStopLoss) * rewardRatio // Target for long position
shortTarget = currHaClose - (shortStopLoss - currHaClose) * rewardRatio // Target for short position
// Calculate position size based on capital risk and set to auto trade 0.01 lot for XAUUSD
capital = strategy.equity
riskPerTrade = capitalRiskPercent / 100 * capital
longPositionSize = math.max(riskPerTrade / (currHaClose - longStopLoss), 0.01) // Minimum 0.01 lot for long position
shortPositionSize = math.max(riskPerTrade / (shortStopLoss - currHaClose), 0.01) // Minimum 0.01 lot for short position
// Strategy Execution: Long Trades
if (buySignal)
strategy.entry("Long", strategy.long, qty=longPositionSize)
strategy.exit("Take Profit", "Long", limit=longTarget, stop=longStopLoss)
// Strategy Execution: Short Trades
if (sellSignal)
strategy.entry("Short", strategy.short, qty=shortPositionSize)
strategy.exit("Take Profit", "Short", limit=shortTarget, stop=shortStopLoss)
// Plot shapes for buy and sell signals
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.blue, style=shape.labelup, text="LONG")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SHORT")
// Alert conditions for buy and sell signals
alertcondition(buySignal, title="Buy Alert", message="Buy Signal Triggered!")
alertcondition(sellSignal, title="Sell Alert", message="Sell Signal Triggered!")
// Plot the Heikin-Ashi Close price for reference
plot(haClose, color=color.gray, linewidth=1, title="Heikin-Ashi Close")
// Plot moving average for trend reference
plot(ma, color=color.orange, linewidth=1, title="Moving Average (Trend Filter)")
Откликнулись
1
Оценка
Проекты
178
39%
Арбитраж
4
25%
/
50%
Просрочено
14
8%
Свободен
2
Оценка
Проекты
35
23%
Арбитраж
4
0%
/
50%
Просрочено
2
6%
Работает
3
Оценка
Проекты
5
0%
Арбитраж
5
0%
/
40%
Просрочено
0
Свободен
4
Оценка
Проекты
695
33%
Арбитраж
43
47%
/
44%
Просрочено
12
2%
Загружен
5
Оценка
Проекты
44
61%
Арбитраж
0
Просрочено
0
Свободен
6
Оценка
Проекты
244
74%
Арбитраж
7
100%
/
0%
Просрочено
1
0%
Свободен
Опубликовал: 1 статью
7
Оценка
Проекты
39
23%
Арбитраж
14
0%
/
93%
Просрочено
4
10%
Свободен
8
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
9
Оценка
Проекты
90
43%
Арбитраж
4
0%
/
100%
Просрочено
3
3%
Работает
10
Оценка
Проекты
1460
72%
Арбитраж
122
29%
/
48%
Просрочено
356
24%
Работает
Опубликовал: 3 статьи
11
Оценка
Проекты
146
34%
Арбитраж
13
8%
/
62%
Просрочено
26
18%
Свободен
Опубликовал: 6 примеров
Похожие заказы
Brotus AI
32+ USD
And let's talk about Linux and more about those technologies, ideas, those AI ideas.Let's make an AI technology summit for us base on wgat i wanna build and their example pictures of roadmapBoss can we take those idea all we've talked about base on technology, tech, UI...J.A.R.V.I.S...eDEX-UI into reality (solution) using laptop cause I think it give accces to build app amd more
مطور برنامج
30+ USD
أحتاج إلى برنامج تداول آلي (EA) مربح للمضاربة السريعة على الذهب. لا أرغب في استخدام استراتيجيات الشبكة أو المارتينجال. إذا كان لديك برنامج متطور وجاهز للعمل، يُرجى التواصل معي. يجب أن تكون قادرًا على توفير نسخة تجريبية
Need A Bot for Auto SL in XAUUSD
30+ USD
I have a bot working XAUUSD. Need another bot to work in XAUUSD as a stoploss @ 10 dollar per trade. A universal one which can work with or without magic number
أريد روبوت تداول آلى
30 - 200 USD
I want a robot that executes round-the-clock trades on Gold, starting with a 0.01 lot size and increasing to 0.02 if the trade moves against the position. The first reinforcement (averaging) step should trigger after a $5 drop; then, the lot size should increase to 0.04 after another $5 drop, and to 0.08 after a further $5 drop. This doubling pattern should continue for every $5 movement up to a total range of $50
Need Trading by AI Robot Analyst
30+ USD
We are seeking an experienced software developer and financial analyst to build an advanced AI trading robot capable of analyzing various market conditions through both technical and fundamental analysis. The system should be able to process real-time data, generate trading signals, and adapt to changing market environments
setup trading alerts on mt5 from hikin Ashi candles i have a strategy script convert it to sent alerts as signals ans sl/tp in mt5 same as tradingview hikin ashi
MT4 or MT5 HFT EA Optimization for Live Trading
100 - 3000 USD
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5 . The EA performs consistently and profitably on demo accounts , but when I run it on an IC Markets Raw and standard live account , it begins generating losses under what appear to be the same trading conditions. if needed i can provide Full EA source code (.mq4 and/or .mq5) and Set file. I need an experienced MQL4/MQL5 developer to thoroughly
Need MT4 EA/ROBOT required
30+ USD
I am looking for an experienced developer to create a custom MT4 Expert Advisor (EA) / trading robot. Requirements: Fully automated trading system for MetaTrader 4 Clear entry and exit strategy (can be based on indicators, price action, or a custom logic) Risk management features (lot size control, stop loss, take profit, trailing stop) Ability to run on multiple currency pairs Option to adjust settings (risk %
Modification for Forexmts
50+ USD
I am a forex trader I want to help to all the other traders with translating and online cources so which is interested buy this package and join us thank you
Kenyan Editor
30+ USD
1.a specific robot to earn for a quick and reasonable trade all over. The Idear of being specific makes me perfect, I want this to be clear that make me a high luxurious person will describe me and I will promise to advertise the market both internally and externally
Информация о проекте
Бюджет
100 - 200 USD
Сроки выполнения
от 1 до 100 дн.