end of day yen m15

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

end of day yen m15

Postby PAULUC02 » Thu Nov 19, 2020 4:40 am

hello apprentice
could you code this PRT code for TS.

Defparam cumulateorders = false // no accumulation of positionsDefparam
preloadbars = 3000//

POSITIONS SIZE
n = 1
//PARAMÈTRES
// The higher the "ratio", the fewer positions there are
ratio = 0.64
// HOURS
startTime = 210000
endTime = 231500
exitLongTime = 200000
exitShortTime = 80000
// INDICATEUR MOMENTUM
OTa = Momentum[26]
c1a = OTa > OTa[11]
MLTa = Momentum[280]
c2a = MLTa > MLTa[20
]OTv = Momentum[4
]c1v = OTv < OTv[5]
MLTv = Momentum[180]
c2v = MLTv < MLTv[40]
CONDBUY = c1a and c2a
CONDSELL = c1v and c2v
// STOP LOSS & TAKE PROFIT (%)
SL = 1
TP = 0.8
Period = 12
// CANDLE REFERENCE to StartTime
if time = startTime THEN
amplitude = highest[Period](high) - lowest[Period](low)
ouverture = close
endif
// LONGS & SHORTS :every day except Friday // between StartTime and EndTime iftime>=startTimeandtime<=endTimeanddayOfWeek<>5
and dayofweek<> 0 and CONDBUY then
buy n contract at ouverture - amplitude*ratio limit
endif
iftime>=startTimeandtime<=endTimeanddayOfWeek<>5
and dayofweek<> 0 and CONDSELL then
sellshort n contract at ouverture + amplitude*ratio limit
endif
// Stop Loss & Take Profit
set stop %loss SLset
target %profit TP
// Exit Time
if time = exitLongTime then
sell at market
endif
if time = exitShortTime then
exitshort at market
endif




The exhibits are taken between 21H and 23:15 (hence the name "EndofDay"), but there are no positions taken on Friday, in order to avoid the weekend of course.

Entry into position:
For entry into position: every night except Friday
- we define an amplitude, represented by the difference between the highest and the lowest of the last 12 15-minute periods
- a buy-by-limit order is sent to the level of the candle socket, minus this amplitude multiplied by a ratio of 0.5 -
an order of the limit is set, the more the amplitude or the amplitude is multiplied. by a ratio of 0.5


Position exit:
Unstoplossetuntakeprofits are forecast for each position, respectively at 1% and 0.8%.
Longs are closed at 8 p.m., shorts are closed at 8 a.m.

this strategy works with pairs (usd / yen; eur / jpy; gbp / jpy; aud / jpy) but for each pair it is necessary to be able to modify the parameters ratio; sl; tp; periods.
AUD / JPY: ratio = 0.4 / SL = 0.75 / TP = 0.9 / Period = 12
// EUR / JPY: ratio = 0.59 / SL = 0.95 / TP = 1.1 / Period = 8
// GBP / JPY: ratio = 0.47 / SL = 0.95 / TP = 1.15 / Period = 10
// USD / JPY: ratio = 0.64 / SL = 1 / TP = 0.8 / Period = 12

thank you.
Attachments
Screenshot_2020-11-19 Algorithme-END-OF-DAY-YEN-M15 pdf.png
PAULUC02
 
Posts: 33
Joined: Fri May 22, 2020 8:22 am

Re: end of day yen m15

Postby Apprentice » Thu Nov 19, 2020 2:50 pm

Your request is added to the development list.
Development reference 2334.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot] and 14 guests