molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sat May 18, 2024 5:30 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Debugging Tool: Stop All Trading After A Loss...
PostPosted: Mon Jan 21, 2013 6:46 pm 
Offline

Joined: Sun Jan 06, 2013 3:13 am
Posts: 5
Hi, I love Molanis!

Here's my question: I have searched without success on Google, at MQL4.com and here in the forum for a code snippet that will stop EA from trading after a losing trade. I want this as a safety switch in live forward testing to prevent EA from a runaway losing streak before I can shut it off to analyze performance. I found http://www.forexfactory.com/showthread.php?t=93595 and http://forum.mql4.com/45711 and http://forum.mql4.com/4579, but they aren't really a cut and paste solution. I want a code snippet I can input to Molanis MQL Block in Strategy Builder. If I discover a solution before I receive an answer, I will post it here for everybody.

What I'm looking for is an "OFF" switch for Hal 9000, before he blows up my account. It could be a variable number of losses to make it useful to more coders, but I only need it to trigger after (1) loss.

Thanks! :ugeek:

_________________
ABENOMICS (USD/JPY): "Together, TO THE STARS"...


Last edited by 007 on Wed Feb 13, 2013 9:31 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Debugging Tool: Stop All Trading After A Loss...
PostPosted: Tue Jan 22, 2013 10:38 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
We do not have that available but you may want to look at the martingale code that says if the last position is a win/lose. Maybe use it as a base to get what you want.
Look in the code for //Martingale lot calculation.


Top
 Profile  
 
 Post subject: Re: Debugging Tool: Stop All Trading After A Loss...
PostPosted: Tue Jan 22, 2013 3:58 pm 
Offline

Joined: Sun Jan 06, 2013 3:13 am
Posts: 5
Ah! Thank you for the clue. I will work on that, and post my results if successful...

_________________
ABENOMICS (USD/JPY): "Together, TO THE STARS"...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009