Announcement

Collapse
No announcement yet.

command line app

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • command line app

    Hi, There:

    I have question here. I need to make a command line app now with the symbol as the argument. The problem is that every time before I get the returned history data, the app will exit. Any suggestion or comment?

    Thanks.

    Jim

  • #2
    I suspect you are new to event driven programing - that is code that responds to events produced by other code rather than a traditional function call. If you are an experienced event driven programmer with a specific issue, I appologize in advance for this elementary response.
    With a traditional function call, the next instruction in your code does not execute until the function (or subroutine) call completes its task. With event driven programming, your code tells the other code (eSignal) to do something while your code continues to execute. On it's own time frame, the other code signals your code with an "event" indicating that your results are ready. If your code's subsequent execution terminates your program before it receives and handles the "event" from eSignal, you never get the results you are looking for - it's like ordering a hamburger and leaving before they call out your order. So, you can create a command line application but your code needs to hang around long enough (maintain state) to receive and handle the eSignal information - otherwise, eSignal has no place to deliver your information. So, the process is just like ordering a hamburger at Burger King - 1) you order the burger with your initial call to eSignal, 2) eSignal fires an event that says your burger is ready and 3) your event handler picks up your burger.

    Comment


    • #3
      Thank you for your reply

      Thank you for your reply. I understand the event driven thing. Maybe I did not make it clear. I tried to let the main function sleep after the RequestHistory method is called. The problem is that how long the thread should sleep since I have no idea when I can get the data. Now I use 20 seconds. But sometimes I can’t get the data. That is my question.

      Comment


      • #4
        Jim,
        There are probably better designers on this site than I but it appears to me that you might want to rethink your design. Using a command line/function call to get a quote from an event based module may not be the best approach because the timing of the return event will always be somewhat unpredictable. Rather than pause your routine, you may want to rewrite your code to respond to events when and if they occur. I actually use two independant processes, one process collects and saves market data while the other process analyzes that collected data. The first process is entirely event driven while the second process is, at the moment, user and clock driven.

        Happy trading.

        Comment


        • #5
          Originally posted by Cone Killer
          Jim,
          There are probably better designers on this site than I but it appears to me that you might want to rethink your design. Using a command line/function call to get a quote from an event based module may not be the best approach because the timing of the return event will always be somewhat unpredictable. Rather than pause your routine, you may want to rewrite your code to respond to events when and if they occur. I actually use two independant processes, one process collects and saves market data while the other process analyzes that collected data. The first process is entirely event driven while the second process is, at the moment, user and clock driven.

          Happy trading.



          Thank you for your help. I have convinced my boss to use desktop app now. But I have another problem. Please refer to. http://forum.esignalcentral.com/show...threadid=24646

          Comment

          Working...
          X