Forum

Problem with EA setting BE randomly

Hi all, As soon as my EA open a trade, the stoploss get directly set to BE and the trade get closed bits by bits within seconds. Even when I try to open the trade manually it does this. However it does not do that all the time and it depends on the instrument. I do not have a single line on my code

Trouble collecting day open equity

Hi all, I am trying to collect the day open equity so I can control my daily drawdown and close all trade if it gets reached. However I don't understand why it is not working. Here is the following code I am testing: double EquityOpenDay; int OnInit () { EventSetTimer ( 15 ); return (

Problem with changing chart timeframe with code

Hi all, I am trying to optimize my EA with with different timeframes as input. Here is how I change the TF within the code, where Timeframe is the input: int OnInit (){ ChartSetSymbolPeriod ( 0 , NULL , Timeframe); ... Then in my code I simply use Timeframe wherever I need it (just in iCustom

Trouble with timeframe changes within code

Hi all, I am trying to optimize my EA with with different timeframes as input. Here is how I change the TF within the code, where Timeframe is the input: int OnInit (){ ChartSetSymbolPeriod ( 0 , NULL , Timeframe); ... Then in my code I simply use Timeframe wherever I need it (just in iCustom

Implementing prop firm rules within my EA

Hello, I am trying to implement the main prop firm rules within my EA: - stop trading when 8% profit reached - stop trading when 10% loss reached - stop trading for the day when 5% drop from the equity at the opening of the day. I have the following code to save the equity at the opening of the day

Testing multiple timeframes as an input for optimization

Hi all, I am trying to test an EA on different timeframes and so I defined timeframe as an input. The code is working fine when tested on a single timeframe. To have the timeframe changed, I simply added the following 2 lines of code. The first one is in the global scope and second one is in the

Partial close with variable size position

Hi all, I am trying to partially close my position once a certain risk reward is reached. Both proportion of the position to be close, and the risk reward needed to be reached are inputs. I am struggling regarding the volume, as I want the partial cloture to happen only once, so when the volume of

Test a code with different starting week over a specified period

Hi all, I am trying to test an EA where it starts each week and see the different results I get. Here is the code (removed all code not related to that matter), it works fine for the first 54 passes and stopped on 1 January 2023. Any idea why? I set the input NumberWeekTest in the Fast genetic from

Big difference between results from optimization and single test with optimized inputs

I am encountering really big differences when I use the optimized setups found from the strategy tester : - I ran the optimization and then "Run single test" on the most profitable inputs directly from the Optimization Results tab (right click on the top row). Here is the graph I get: - Then I set

Strategy tester optimization problem

Hi all, I am trying to optimize an EA, I have no trouble testing my strategy on a single test but once I try to optimize the inputs or test it on multiple symbols, the test run but not a single trade is taken on any pass. I don't receive any error. Any one had a similar problem? I tried to define my