User's DDE server, was: OHLC are all same


I am developing quant trading system for myself. I need to test the full working cycle by simulating the process as close to the reality as possible.

This system is feeding Amibroker with old intraday data from my own DDE server.
After pushing data for each period for all stocks, it triggers a scan and takes actions based on the alerts.

The Realtime Quote window shows different values for Open, High, Low and Close.
But during AFL Scan execution, all values (O, H, L, C) appear same.
Same is the appearance in the chart. Each price bar appears flat as 1 pixel red line.

However GetRTData() function gives those values correctly as those appear in Realtime Quote window.

I have several variations of AFLs to test.

Do I need to edit all AFLs and replace each reference of O, H, L and C with GetRTData()
or is there an easier/quicker way to get correct values from O, H, L, C - so I wouldn't need to edit AFLs?

As an alternative of DDE, I tried setting database to "local" and fed same data to Amibroker via OLE objects (vbscript).
It worked and this issue was solved but that process worked 3-4 times slower than DDE data feed.
I could not use that solution because I need to run this process much faster.

I will appreciate if you guys can offer any helpful clue.


Clearly you don't understand what you are feeding using YOUR dde server and how intraday bars are constructed.
What you feed by means of DDE are not intraday bars, but quote snapshot that includes real time LAST price (Close), and DAILY High/Low/Open (they are NOT used for anything but display daily OHL in RT quote).
OHLC intraday bars are build from realtime LAST price over time by DDE plugin IF and only IF you feed more ticks AND they ticks differ in LAST price.

@Tomasz Thanks for taking time to reply to my question.

I intend to test various AFLs without giving all data to Amibroker at once.
Source data is in one minute intervals.
I need to give it one period data at once and run the scan ... repeat till data finishes for one trading session.

I want to

  1. perform this test as fast as possible and
  2. also want to use the OHLC price levels per minute as I have in the source data.

What would be the fastest setup to achive these two objectives?

OHLC values appear correctly, if I use "local" database setting and I add one quotation in each stock at a time using OLE objects (vbscript) - but that process runs very slow (approx 150ms to add one quotation in one stock). That is using Intel i7-3770 with 16GB RAM.

Using DDE, Amibroker receives OHLC values correctly but AFL gets those using GetRTData function and not simply by using O, H, L and C variables.

If there's no easier solution then I will have to edit hundreds of the AFL variations and replace references of O, H, L and C with GetRTData().

Use AmiBroker's own Bar Replay.

It just works. It is zillions of times better than any other "solution".

Very interesting @Tomasz :slight_smile:

Hats-off to you and your team for development of Amibroker and continuous support .

I understand that Bar Replay would serve my need if I would be running tests manually/interactively.

My scripts are fully automated at this point (thanks for the OLE automation that Amibroker offers).

Can I trigger Bar Replay by using some method of OLE objects?
I cannot find such method in

I really appreciate your help!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.