EA or Script? Global vars?
Results 1 to 6 of 6

Thread: EA or Script? Global vars?

  1. #1
    Hi,
    Ive got an app that Ive written that works fine. . (EA)

    Ive got the following concerns. .



    1. This really is a Hedge app that monitors 4 charts. I dont like the idea of conducting my ea cuz they could step on each on each other. . Ive looked at using gloabal vars, since there are no built in Semiphores, mutexes etc.. To the system.

    2. If I track one chart, and its moving, I may not get ticks. .


    So, Im tempted to simply run a script in a loop, sleeping 500 ms on each loop.

    Im mostly interested in what my profit for all trades are doing. . Not what every pair is performing. . Makes for a EA that is hard.


    Any ideas??


    Gordon

  2. #2

  3. #3
    I'd write it like a script and loop while! IsStopped(), and I've recently done just this for somebody who needed to track multiple positions across numerous pairs.

    You mention usage of a mutex, here's a code sample which describes placing a semaphore for access to global factors.

    IsTradeContextBusy will only determine if an EA (or script) can interact with the host and submit orders, it won't do anything for you otherwise.

  4. #4
    Quote Originally Posted by ;
    utilize IsTradeContextBusy
    All that really does is create a vital section around the trade routines. . But not the remainder of the Start()

    It may still battle. .

    Ive decided to write a script. .

  5. #5
    Quote Originally Posted by ;
    I would write it like a script and loop ! IsStopped(), and I've recently done just this for somebody who needed to monitor multiple positions across multiple pairs.

    You cite usage of a mutex, here's a code sample which clarifies placing a semaphore for access to global factors.

    IsTradeContextBusy will only recognize if an EA (or script) can interact with the server and submit orders, it will not do anything to you differently.
    Thanks!
    Actually, thats exactly what I did. . I created a global var. . I save the TimeCurrent() value within it. .

    I upgrade this value within my operating loop, roughly every 1000ms.

    Afterward, when a different iteration looks at it, if its new. . Subsequently it disallows use..If its old, then it presumes its wrapped up, and allow it to proceed. .

    The script is a lot better. . Enables control. . Why Ive ever done an EA wondering.

    Scares me to death that a user will suppose that the robot is running, when in reality its locked up and lost trades. .

    This EA engine is actual cludgy. If be a var or something. . This global var thing stinks. .

    Gordon

  6. #6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners more information