ema script with time

thread: ema script with time

  1. #1

    ema script with time

    I was wondering if I could add time to my 2 ema crossover script. I'd love to wait before the candlestick has shut until I check to find out whether they've crossed. Is this possible. I dont need it to be checking every tick.

  2. #2
    Member gas's Avatar
    41
    There is a way to make it wait for Bars to look at your requirements. . Don't know the code. .

    You can also try setting the change to 1, so it seems in the previous bars rather than the current one.


    I'm off crossing moving averages = P

    But what I used earlier when I was attempting to make an EA myself was:
    sufx.core.t3-ism. Net/ExpertAdvisorBuilder/

    Employed it as a template and added to it. When you look at that, there is a choice under orderoptions for bar. That means it's possible to find.

  3. #3
    Basically, the difficulty that I'm having is that when 8 day averages and my two day have been in the process of crossing, I'm seeing buy as every tick might create the two day and 8 day and sells cross multiple occasions. I want to stop this. Am I approaching the issue in a manner that is correct by having my EMA_cross script buy and sell according to the candlestick?

  4. #4
    Member gas's Avatar
    41
    Visit with the site I posted, and produce the EA. It sounds simple, like I wrote before, under Order Options place it to finish bar so it only checks following a pub is complete, rather than each tick.
    I don't know the specific code for it .

  5. #5
    visit the Site I posted, and make the EA. It seems easy, like I wrote before, under Order Options set it to finish pub so that it only checks following a pub is complete, and not every tick.
    I really don't know the exact code for it though.
    SorryI didn't see the new article before I clicked submit for my followup post. I'll try that out.
    Thank you for your help!

  6. #6
    Now that I have the quick fire buys and sells fixed (thanks!) , I have a new issue.

    That I would like the professional advisor to buy and sell at crossings of the two day and 8 day EMAs (buy on an upward cross, sell on a downward cross). On the other hand, the specialist advisor is buying or selling at every bar that is comprehensive, depending on if which EMA is bigger. How can I maintain the expert advisor aware that it has an open buy or sell, rather than repeat the action?

    In short, the logic I want is that:
    Open a buy when the two EMAs cross, and the two day EMA is higher than the day EMA.

    No action until...

    Close the buy order when then two EMAs cross , and the 8 day EMA is higher than the two day EMA. Open a sell order.

    Repeat.

    I think I understand that the code for how to do so, but I'm wondering if I could find the builder to do it for me and I'm just missing something very obvious.

    Thank you in advance!

  7. #7
    Or, I want the script to test to see whether there are any open buy or sell orders, and if there are, perhaps not to buy . How do I add this functionality?

    Thank you in advance.

  •