Help: How to write simple EA to buy and sell at a specific time? - page 8

 

Hi Guys,

I found TimeBasedEA at the beginning of this threat, please someone explain what 'Magic Number' is???

Thanks a lot

 
ichanz:
Hi Guys,

I found TimeBasedEA at the beginning of this threat, please someone explain what 'Magic Number' is???

Thanks a lot

It's just a number that identifies that particular EA. Is needed when you have more than one EA working together. You don't want that one EA closes other EA trades.

 
ichanz:
Nice thought, Somebody please tell me where to start, i will glad to spend couple of weeks to learn. It's worth to try

You can try here: Forex Trading Online Training: Learn Foreign Exchange Currency Trading

FerruFx

 
ryan56:
Hi all,

I was just wondering if anyone could help me write and EA or a simple script allowing me to open various orders (buys and sells) at a specific time.

To be clear, what I need is the following (as an example):

- Open 2 buy orders and one sell order at 11:00AM GMT for any pairs and with TP butr no stop loss

- Open 3 sell order and one buy order at 05:00AM GMT for any pairs and with TP and no stop loss

My trading strategy depends on time mainly and this is why I cannot put pending orders since they depend rather on time than price.

Thanks for assistance

Ryan

HI ..to all of you..

Anyone develop such script? would like to have it as well..

god bless you.

 

Pending order buy/sell based on time....

Puzastyle:
HI ..to all of you..

Anyone develop such script? would like to have it as well..

god bless you.

I've backtested USDJPY at 0700 hrs and 2000hrs using TIMEBASEDEA with my broker and give me a very good result.

Don't know how to attached the result here, so I just copy&paste the result as below ;

1st test at 2000hrs ( 1 MAY - 29 July )

Bars in test 2494

Ticks modelled 735703

Modelling quality 89.62%

Mismatched charts errors 40

Initial deposit 1000.00

Total net profit 1407.15

Gross profit 1407.15

Gross loss 0.00

Profit factor

Expected payoff 29.94

Absolute drawdown 688.35

Maximal drawdown 786.24 (71.61%)

Relative drawdown 71.61% (786.24)

Total trades 47

Short positions (won %) 0 (0.00%)

Long positions (won %) 47 (100.00%)

Profit trades (% of total) 47 (100.00%)

Loss trades (% of total) 0 (0.00%)

Largest

profit trade 45.03

loss trade 0.00

Average

profit trade 29.94

loss trade 0.00

Maximum

consecutive wins (profit in money) 47 (1407.15)

consecutive losses (loss in money) 0 (0.00)

Maximal

consecutive profit (count of wins) 1407.15 (47)

consecutive loss (count of losses) 0.00 (0)

Average

consecutive wins 47

consecutive losses 0

2nd test at 0700 hrs (1 May- 29 July)

Bars in test 2494

Ticks modelled 735703

Modelling quality 89.62%

Mismatched charts errors 40

Initial deposit 1000.00

Total net profit 1379.12

Gross profit 1479.62

Gross loss -100.50

Profit factor 14.72

Expected payoff 26.02

Absolute drawdown 63.74

Maximal drawdown 480.19 (30.05%)

Relative drawdown 30.05% (480.19)

Total trades 53

Short positions (won %) 0 (0.00%)

Long positions (won %) 53 (98.11%)

Profit trades (% of total) 52 (98.11%)

Loss trades (% of total) 1 (1.89%)

Largest

profit trade 30.24

loss trade -100.50

Average

profit trade 28.45

loss trade -100.50

Maximum

consecutive wins (profit in money) 52 (1479.62)

consecutive losses (loss in money) 1 (-100.50)

Maximal

consecutive profit (count of wins) 1479.62 (52)

consecutive loss (count of losses) -100.50 (1)

Average

consecutive wins 52

consecutive losses 1

I also backtest GBPJPY

best time to Buy at 1300hrs and 2130hrs

best time to sell at 0000hrs.

becasue i can't ON my PC for the all day long so I really need a programme the can open position at specific time only.

My strategy is just to open micro account with 1k deposit.. and trade it for a month with this strategy and study the result.....

Hope someone can help me....

Thank you....

 

GBPJPY at 1300hrs

1st test GBPJPY (buy) at 1300hrs

Bars in test 2329

Ticks modelled 1451818

Modelling quality 65.05%

Mismatched charts errors 0

Initial deposit 1000.00

Total net profit 562.23

Gross profit 562.23

Gross loss 0.00

Profit factor

Expected payoff 9.37

Absolute drawdown 91.12

Maximal drawdown 183.63 (16.81%)

Relative drawdown 16.81% (183.63)

Total trades 60

Short positions (won %) 0 (0.00%)

Long positions (won %) 60 (100.00%)

Profit trades (% of total) 60 (100.00%)

Loss trades (% of total) 0 (0.00%)

Largest

profit trade 13.52

loss trade 0.00

Average

profit trade 9.37

loss trade 0.00

Maximum

consecutive wins (profit in money) 60 (562.23)

consecutive losses (loss in money) 0 (0.00)

Maximal

consecutive profit (count of wins) 562.23 (60)

consecutive loss (count of losses) 0.00 (0)

Average

consecutive wins 60

consecutive losses 0

 

GBPJPY ( sell ) at 0000 hrs

Bars in test 2329

Ticks modelled 1451818

Modelling quality 65.05%

Mismatched charts errors 0

Initial deposit 1000.00

Total net profit 511.69

Gross profit 511.69

Gross loss 0.00

Profit factor

Expected payoff 9.14

Absolute drawdown 259.98

Maximal drawdown 269.24 (26.68%)

Relative drawdown 26.68% (269.24)

Total trades 56

Short positions (won %) 56 (100.00%)

Long positions (won %) 0 (0.00%)

Profit trades (% of total) 56 (100.00%)

Loss trades (% of total) 0 (0.00%)

Largest

profit trade 9.26

loss trade 0.00

Average

profit trade 9.14

loss trade 0.00

Maximum

consecutive wins (profit in money) 56 (511.69)

consecutive losses (loss in money) 0 (0.00)

Maximal

consecutive profit (count of wins) 511.69 (56)

consecutive loss (count of losses) 0.00 (0)

Average

consecutive wins 56

consecutive losses 0

I'm sorry with the many posts...

IF the TP doesn't hit in the same day... thats our opportunity to gain more pips by.. placing order step by step example..

USDJPY 28.07.08 at 0700hrs

EA open buy at 107.83 , TP 107.93 but it didn't hit it went down to -50pips below, we can place another buy order here 107.30 with TP 107.93, it hit last night when the price go up to 108..

based on EA... price can go below -160pips... so we can place another order

-50, -100, -150....

just think of some strategy... based on EA result...

*no stop loss apply*

 

EA strategy for TIMEBASED

hi. me again..

can someone help me to modify TIMEBASEDEA as below ;

add multiple order buy/sell if TP didn't hit with setting 50/100/200 point diff with the open price...example USDJPY

open buy UJ at 0700hrs with TP10..

(on 28/7) at market price 107.83...TP 108.83

open pending order at price 107.33, 106.83 and 106.33.... if TP hit.. no order will open....wait for next cycle 0700hrs...

manual back test show that by doing this...we can maximise the profit..

max DD 160 point (18/3-30/7)

max pip may gain ..(10+50+100+150=310pips) per cycle....

hope can test this strategy with EA...

 

Need Simple EA please

Looking for an EA that checks a time that I want like 09:00 and depending on the bars middle price, set a BuyStop and SellStop order at the price or pips away that I want?

Thank you

 

I've answered a few of your questions before. It looked like your were trying to write you own which is great. What's the problem you're having with this one?

Lux

Reason: