Trading strategy

명시

//@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
개발자 1
등급
(132)
프로젝트
178
39%
중재
4
25% / 50%
기한 초과
14
8%
무료
2
개발자 2
등급
(15)
프로젝트
34
24%
중재
3
0% / 33%
기한 초과
2
6%
작업중
3
개발자 3
등급
(3)
프로젝트
4
0%
중재
2
0% / 0%
기한 초과
1
25%
무료
4
개발자 4
등급
(535)
프로젝트
613
34%
중재
32
41% / 47%
기한 초과
9
1%
바쁜
5
개발자 5
등급
(31)
프로젝트
43
60%
중재
0
기한 초과
0
무료
6
개발자 6
등급
(75)
프로젝트
228
72%
중재
6
100% / 0%
기한 초과
1
0%
무료
7
개발자 7
등급
(26)
프로젝트
33
24%
중재
1
0% / 0%
기한 초과
3
9%
로드됨
8
개발자 8
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
9
개발자 9
등급
(51)
프로젝트
81
42%
중재
3
0% / 100%
기한 초과
2
2%
작업중
10
개발자 10
등급
(839)
프로젝트
1430
72%
중재
117
29% / 47%
기한 초과
354
25%
작업중
게재됨: 3 기고글
11
개발자 11
등급
(69)
프로젝트
146
34%
중재
11
9% / 55%
기한 초과
26
18%
무료
게재됨: 6 코드
비슷한 주문
This ICT based indicator utilizes 4 concepts. Fair value gaps , liquidity sweeps , Change in state of delivery . Swing points highs and lows . If the indicator can be executed correctly ideally i would want to make an EA right after with the same developer and i will pay more . i also have the raw codes for the liquidity sweeps and fvgs , getting the CISD created and merging them is the job but i would like to make a
Mt5 30+ USD
"I would like to order an Expert Advisor for MetaTrader 5. The EA should open buy and sell trades based on Moving Average crossovers and use a fixed lot size of 0.01. It should also have a Stop Loss and Take Profit feature that I can adjust. Please make it compatible with MetaTrader 5 and provide me with the source code."
What would your fee/price be to translate this basic pinescript indicator (Range Filter Buy and Sell 5min - guikroth version) into an MQL5 EA? (I do not need; any of the on-chart visual elements or the Heiken Ashi option. Just 3 things: the "Sampling Period", the Range Multiplier", and "Source" if possible.) I would need the Buy/Sell signals to translate EXACTLY to MT5 trades, and it must be able to back test and
I want an EA expert to provide me a bot that works in all market conditions without any news filter it logic is simple to understand I dont know about how creation of this will be but I have similar EA where account is working but I want to get my own EA
I need to combine and modify 2 EA's and add some conditions to them. I also need optimize them because they have some error and bugs. The developer needs to know how to use MACD , supply and demand zones , lock and martingale
I am looking for an experienced developer who can create a MetaTrader 5 (MT5) Expert Advisor (EA) based on a single TradingView indicator and a set of Buy/Sell conditions that I will personally share with you. Requirements: Convert the TradingView indicator (Pine Script) logic to a working MT5 EA Implement specific Buy and Sell conditions (I will provide exact rules) EA must include basic risk management options (Lot
I need a clean, simple EA for MT5 that consistently produces ~5% monthly return with moderate trade frequency (6–12 trades/week). - Must auto-compound or use risk-based lot sizing - Must include .mq5 source file , not just .ex5 - Must show backtest proof on 2 different pairs , preferably M30/H1 - Must be original or legally yours to transfer, this will be used in a broader structured trading setup I’m building I
To develop EA algo on GBPUSD on MT5 Client will provide the necessary indicator which will plot Daily pivots on the chart. PFA screenshot attached for details of job work
Description de la stratégie de trading : Bot de trading ULTIMATE AI Smart Money Concept (SMC) Aperçu: J'ai besoin du robot de trading IA ultime, conçu pour mettre en œuvre une stratégie de trading Smart Money Concept (SMC) axée sur l'identification des configurations de trading à forte probabilité en fonction de la structure du marché, des blocs d'ordres et de l'évolution des prix. Ce robot vise à capitaliser sur le
Trading Strategy Description: ULTIMATE AI Smart Money Concept (SMC) Trading Bot Overview: i need The ULTIMATE AI trading bot that is designed to implement a Smart Money Concept (SMC) trading strategy that focuses on identifying high-probability trading setups based on market structure, order blocks, and price action. The bot aims to capitalize on institutional trading behavior by analyzing price movements and

프로젝트 정보

예산
100 - 200 USD
개발자에게
90 - 180 USD
기한
에서 1  100 일