Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 21:08:37 +0000



Post From: Possible to Develop own Trading / Execution - Using Signals from Sierra Chart?

[2017-12-01 22:36:10]
Sporken - Posts: 82
If they have an API then your fastest to way to communicate is using shared memory. The Boost library has a very easy implementation.

http://www.boost.org/doc/libs/1_55_0/doc/html/interprocess/sharedmemorybetweenprocesses.html

If it's not C++ or has weird restrictions then a slower alternative is to communicate between the processes by writing files to predetermined folders and then using the OS folder watching calls to detect changes to the files.

  
  HANDLE m_dwChangeHandles[2];

  m_dwChangeHandles[0] = FindFirstChangeNotification(
    FOLDER_PATH, // directory to watch
    FALSE, // do not watch subtree
    FILE_NOTIFY_CHANGE_FILE_NAME); // watch file name changes

  if (m_dwChangeHandles[0] == INVALID_HANDLE_VALUE)
  {
    LOGERROR("FindFirstChangeNotification function failed.\n");
    ExitProcess(GetLastError());
  }
  
  m_folderChanged = true;

and later something like

  //  DWORD dwWaitStatus = WaitForMultipleObjects(1, m_dwChangeHandles, FALSE, INFINITE);
  DWORD dwWaitStatus = WaitForMultipleObjects(1, m_dwChangeHandles, FALSE, 10);
  if (dwWaitStatus == WAIT_OBJECT_0)
  {
    LOGINFO("Folder changed.");
    m_folderChanged = true;
    if (FindNextChangeNotification(m_dwChangeHandles[0]) == FALSE)
    {
      LOGERROR("FindNextChangeNotification function failed.\n");
      ExitProcess(GetLastError());
    }
  }

ps. I'm not Sierra support, I just wanted to be helpful.
Date Time Of Last Edit: 2017-12-01 22:37:34