• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 5:17am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:17am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Strategy tester just stops when running this code and idk why 7 replies

strategy builder/tester for new scalping strategy 1 reply

EA only working on strategy tester? 4 replies

Debug code in strategy tester 1 reply

2009.03.11 15:41:15Tester memory handler: tester stopped because not enough memory 19 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: How to code an EA that's only available on strategy tester?
Cancel

How to code an EA that's only available on strategy tester?

  • Post #1
  • Quote
  • First Post: Nov 29, 2021 7:43am Nov 29, 2021 7:43am
  •  zac1987
  • | Joined Jun 2018 | Status: Member | 35 Posts
I want to sell my EA, but I want to let customers backtest my EA before they buying my EA.

How is the mql4 code to only allow EA open trade on strategy tester but not allow EA open trade on demo / real account?
  • Post #2
  • Quote
  • Nov 29, 2021 9:12am Nov 29, 2021 9:12am
  •  PaulMF
  • Joined Apr 2020 | Status: Member | 866 Posts
Quoting zac1987
Disliked
I want to sell my EA, but I want to let customers backtest my EA before they buying my EA. How is the mql4 code to only allow EA open trade on strategy tester but not allow EA open trade on demo / real account?
Ignored
You may use the OnInit and IsTesting functions:

Inserted Code
int OnInit()
{
   if(!IsTesting())
   {
      Print("Pay my bill");
      return(INIT_FAILED);
   }
   return(INIT_SUCCEEDED);
}
Always ready to help
 
 
  • Post #3
  • Quote
  • Dec 12, 2021 11:45pm Dec 12, 2021 11:45pm
  •  zac1987
  • | Joined Jun 2018 | Status: Member | 35 Posts
Thank you.
 
1
  • Post #4
  • Quote
  • Last Post: Dec 29, 2021 5:41am Dec 29, 2021 5:41am
  •  Musharib
  • | Joined Nov 2021 | Status: Member | 48 Posts | Online Now
hello there !
how to code EA to take 1 trade per signal and wait for new signal for next trade even it hit tp.

Example
if EA place buy trade in buy signal and it hit the 5pip and current trend is buy when tp hit it will not place anymore trade in buy trend it will wait for next new signal which will be sell then it will place sell trade .


any code or function for this

 
 
  • Platform Tech
  • /
  • How to code an EA that's only available on strategy tester?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023