EA Programming Questions ???
Results 1 to 6 of 6

Thread: EA Programming Questions ???

  1. #1
    Hi all,

    I'm new to EA programming .... Though I have clocked numerous years in C, C and Pascal programming....

    Among the thing I noticed was that the Strategy Tester by Metatrader utilizes Open Prices for its back testing. Therefore the EA will also base its Entry and Exit on this Open Prices.

    Is there any way to based the EA Entry Exit on the Close Price instead? I feel that this result would be more accurate since we usually enter a trade based on the prior bar's Closing Price rather than the current bar's Open Price.

    Thank you for any advices ahead!!!

    Rgds,
    Ken W

  2. #2
    Is up to the programmer, in which its decisions are looked for by the ea. If I decide to look at the prior candles close for my decision do I not have to watch for the new candle to shape before the prior one being completed? Which actually would produce a position opens at the current price.

  3. #3
    Thank you . I get what u mean.

    Originally, after doing a run on the egy tester, with an entrance such as

    If (Signal_Current gt; 0 Signal_Previous1 lt; 0)
    Enter Order

    I found it isn't 100% performing this instruction. You will find misses where there ought to have been entries, or entries where there shouldn't have been. I presumed this issue should have been caused by where the Current Bar's Open Close pricing is.

    The EA acted about the Opening Bar price. However, what we see plotted on the indior chart is your Final Bar price.

    I did a retest using a formula such as this
    If ((Signal_Current gt; 0 Signal_Previous1 lt; 0) || (Signal_Current gt; 0 Signal_Previous2 lt; 0))
    Enter Order

    It appear to reach 99% accuracy.

  4. #4
    Hey guys! I'm also new to EA programming and have been trying to compute Weekly Account Profit and display it in my chart with no success. I am able to use the Comment() work fine, but have not come up with the appropriate code for calculating Weekly Profit. I've used AccountProfit() and OrderHistoryTotal() works, but it just does not seem to work. Can anybody help me?

  5. #5
    Quote Originally Posted by ;
    Hey guys! I am also new to EA programming and have been attempting to compute Weekly Account Profit and display it in my chart with no success. I am able to use the Comment() work fine, but haven't come up with the appropriate code for calculating Weekly Profit. I have used AccountProfit() and OrderHistoryTotal() functions, but it simply does not seem to work. Can anybody assist me?
    On sunday night or monday whenever you start the week, then copy the account balance into a global factor (look under globalvariableget, globalvariableset). Then at the end of the week compare the current balance with the one saved in the global variables.

    Make sense??

  6. #6
    Quote Originally Posted by ;
    on sunday night or monday whenever you begin the week, copy the account balance into a global factor (look under globalvariableget, globalvariableset). Then at the close of the week compare the current equilibrium with the one saved in the global variables.

    Make sense??
    Yes, conceptually it makes sense, however attempting to code it baffling to me. Where would I begin. The EA have coed thus much is very, very straightforward. My objective is to evenualy possess the EA halt trading once it reaches a Weekly Profit/Loss Threshold, but I can not begin to try out that without having the calculation coded. Can you supply the code which employs the globalvariablege, globalvariableset works, please? I lost and frued. Thanks.

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.