Would anyone have a go at coding this?
Forums › ProRealTime English forum › ProOrder support › Would anyone have a go at coding this?
- This topic has 6 replies, 4 voices, and was last updated 2 months ago by GraHal.
-
-
09/30/2024 at 7:29 PM #238301
I am massively incompetent when it comes to coding and I am here for help. I keep missing out on trades in a particular strategy and want to see if automating it would make it easier. My filters for it are structure in higher time frame and an ema but I am happy to assess that myself. The entry conditions for a long, that I’d like someone to code for me, are:
- Last Candle – Negative body candle
- Current Candle – Positive body candle
- Close within top third or quarter of candle body
Entry
- Stop long order to trigger let’s say 5 points higher than the top of the current candle
- UK spread betting so per point rather than contracts
- Stop loss order let’s say 5 points under the current candle
- Extra options:
- Order good for x minutes (I think the broker allows that)
- The buy price must be minimum y points under the highest high of the last 10 ish candles. I don’t want to buy into new area.
- Max risked points (Stop entry minus stop loss) =z
I’d happily pay someone if available.
Thank you very much,
C
10/01/2024 at 3:41 PM #238357Here you have an example:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546// Configurable parameters declarationpuntosEntrada = 5 // Points above the current candle to trigger the buy stop orderpuntosStop = 5 // Points below the current candle for the stop lossvalidacionMinutos = 10 // Duration of the order in minutesdistanciaMaxima = 10 // Minimum points below the highest high of the last 10 candles where the buy price should beriesgoMaximo = 15 // Maximum risk points allowed (stop entry - stop loss)ratioBeneficio = 2 // Ratio to calculate the take profit target (e.g., 2:1)// Candle variablescuerpo = abs(open - close) // Body size of the current candlerango = High - Low // Range of the current candle// Defining candle conditionsPreviousCandleNegative = Open[1] > Close[1] // Previous candle with a negative bodyCurrentCandlePositive = Close > Open // Current candle with a positive body// Close within the top third or quarter of the candle bodycloseInUpperThird = Close > (High - (rango / 3))closeInUpperQuarter = Close > (High - (rango / 4))// Identification of the highest high of the last 10 candleshighestHighLast10 = HIGHEST[10](High)y = 10 // Variable used as an example// Entry conditions for a long positionIF PreviousCandleNegative AND CurrentCandlePositive THENIF (closeInUpperThird OR closeInUpperQuarter) THEN// Calculate entry and stop levelsentryLevel = High + puntosEntrada * POINTSIZEstopLevel = Low - puntosStop * POINTSIZEriskPoints = entryLevel - stopLevel// Calculate the take profit targetprofitTarget = entryLevel + riskPoints * ratioBeneficio// Check additional conditionsIF entryLevel < (highestHighLast10 - distanciaMaxima * POINTSIZE) AND riskPoints <= riesgoMaximo * POINTSIZE THEN// Place buy stop orderBUY 1 contract AT entryLevel STOP// Set stop lossSET STOP price stopLevel// Set take profit targetSET TARGET price profitTargetENDIFENDIFENDIF1 user thanked author for this post.
10/02/2024 at 8:00 AM #238389Hello Catalin
On which instruments, timeframe do you plan to investigate this strategy ?
Do you have backtest results you could share ?
I am personally investigating future index tradings (small Nasdaq, Dow, CAC, DAX). Let us see if we have common interests.
Thanks
10/02/2024 at 9:31 AM #23839210/02/2024 at 12:31 PM #23840510/05/2024 at 10:16 AM #238504Hi, I meant to say that what I asked for help with only covers they entry side of things. Getting in at retest of structure is what I believe gives it a chance to work and I have no hope to code that. So my plan is to set up alerts at levels that make sense and then set the algo so I dont have to waste hours waiting for an entry.
10/05/2024 at 11:46 AM #238522I dont have to waste hours waiting for an entry.
If with IG then you can set a Notification Alert to your phone when a trade is opened.
Re code for market structure … if you can state in plain english what you want your code to do then there are a few very kind ‘coding wizards’ on here who would code it for you.
Plain english specification in bullet points are good as easy to follow and makes for brief statements of requirements.
-
AuthorPosts
Find exclusive trading pro-tools on