MT4 (Basic) Questions

 

Hi All,

New to MT4 programming. I have most of my EA programmed but I wasn't sure how to determine the following:

1. How do I know when a pending order becomes an open order (i.e. filled)? I checked the documentation but I couldn't find how to distinguish between these two.

2. Is the only way to backtest by running the strategy tester? I was hoping to run a 6 month backtest - naturally this would take a long time using the Strategy Tester....I assume an alternative would be via code - hoping for any samples or advice on how to best do this.

Many thanks!

 

1. How do I know when a pending order becomes an open order (i.e. filled)?

Pending orders are OP_BUYLIMIT/OP_BUYSTOP, while an open order is OP_BUY. Same for sell orders

2. Is the only way to backtest by running the strategy tester? I was hoping to run a 6 month backtest - naturally this would take a long time using the Strategy Tester....I assume an alternative would be via code - hoping for any samples or advice on how to best do this.

When I start with a new stragtegy, I'll write an inidcator that displays entry and exit points on the chart, and prints the number of pips to the log. You can also color bars durning the trading similar to what Heiken-Ashi does. While not anywhere near as accurate as backtesting, it let's you eye-ball things and see if the strategy is worth presuing.

 
4xCoder:
1. How do I know when a pending order becomes an open order (i.e. filled)?

Pending orders are OP_BUYLIMIT/OP_BUYSTOP, while an open order is OP_BUY. Same for sell orders

2. Is the only way to backtest by running the strategy tester? I was hoping to run a 6 month backtest - naturally this would take a long time using the Strategy Tester....I assume an alternative would be via code - hoping for any samples or advice on how to best do this.

When I start with a new stragtegy, I'll write an inidcator that displays entry and exit points on the chart, and prints the number of pips to the log. You can also color bars durning the trading similar to what Heiken-Ashi does. While not anywhere near as accurate as backtesting, it let's you eye-ball things and see if the strategy is worth presuing.

Thanks!

So, just so I understand - if I use OrderSend with OP_BUYLIMIT and it returns say 123 for my ticket number.

Are you saying that if/when my order gets picked up it will change that same order (ticket 123) to the type OP_BUY?

With regards to the backtesting....I don't mind "Printing' or otherwise outputting what the trades would have done.....but I guess using the close of bars is the only way to exit to get any kind of accuracy.

Also, would this be just a matter of looping from the start of the chart to the end of the chart? Would you normally add a parameter for "Backtest" where if it's true loop back and back test otherwise, it is treated as a "live" EA?

I guess the other option is to let the Strategy Tester run for a very long time?

Thanks again!

 

Need help

Hi,

Can anyone help me? I have an EA that has made me 200-500 pips per week. I want to market the EA but I dont want anyone to know the code. Is there any way that I can hide the code so that no one knows?

Thanks

Marlow

 
marlow2007:
Hi,

Can anyone help me? I have an EA that has made me 200-500 pips per week. I want to market the EA but I dont want anyone to know the code. Is there any way that I can hide the code so that no one knows?

Thanks

Marlow

WOW! 200-500 pips a week! Why would you want to market such an ATM machine?

Seems like you could all but print money with this amazing EA of yours!

Don't worry about "marketing" this one, just retire with it! HeHe

 
wolfe:
WOW! 200-500 pips a week! Why would you want to market such an ATM machine?

Seems like you could all but print money with this amazing EA of yours!

Don't worry about "marketing" this one, just retire with it! HeHe

Yeah,

I know but I have been trying to create this EA for 5 years now and I finally

have it made and tested. I need the starting capital. Im looking to get $5000 USD then I will quit selling it just enough to get started.

CAN ANYONE HELP? I need to hide the contents to the code so I can market this EA. Thank you

Marlow

 
marlow2007:
Yeah,

I know but I have been trying to create this EA for 5 years now and I finally

have it made and tested. I need the starting capital. Im looking to get $5000 USD then I will quit selling it just enough to get started.

CAN ANYONE HELP? I need to hide the contents to the code so I can market this EA. Thank you

Marlow

You could offer your product as signal with our new forum service: https://www.mql5.com/en/forum/178803

Reason: