You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If you are looking for a condition only at the moment of the birth of a new bar, why are you doing this AT EVERY TICK?
i had removed EVERY TICK on the current script before i sent the code. The EA is working properly Vladimir.
Thanks very mush to you i would not have done this alone. I am also grateful for your support.
Hi Vladimir
I have been doing a number of tests on a number of instruments that i want it to trade.
I have created a separate script which the EA should open sell trades, changed Ask to Bid, changed/ reversed the condition signals, used InpOrderSize and SellTP/SellSL.
I do not understand why the EA keeps on executing Buy trades only with the same lot size, same TakeProfit and same StopLoss but on different instruments.
Every parameter that i have changed to suit each instrument remains the same.
What could be the problem on the script?
OnInit must return a predefined variable:
ID
Description
INIT_SUCCEEDED
Initialization successful, EA test can be continued.
This code means the same as the zero value – the EA initialization in the tester is successful.
INIT_FAILED
Initialization failed. There is no point in continuing the test due to unavoidable errors. For example, it is impossible to create an indicator necessary for the EA operation.
The return of this value means the same as returning the value different from zero – EA initialization in the tester failed.
INIT_PARAMETERS_INCORRECT
Designed to denote an incorrect set of input parameters by a programmer. In the general optimization table, the result string with this return code is highlighted in red.
A test for such a set of EA inputs is not performed. The agent is ready to receive a new task.
When this value is received, the strategy tester does not pass this task to other agents for repeated execution.
INIT_AGENT_NOT_SUITABLE
No program execution errors during initialization. However, for some reasons, the agent is not suitable for conducting a test. For example, there is not enough RAM, no OpenCL support, etc.
After returning this code, the agent no longer receives tasks until the very end of this optimization.
If you work only at the time of the birth of a new bar, WHY DO YOU NOT LISTEN AND ASK FOR INFORMATION
on every tick ???
If you work only at the time of the birth of a new bar, WHY DO YOU NOT LISTEN AND ASK FOR INFORMATION
on every tick ???
I seem to get lost. By working only at the time of the birth of a new bar, i wanted the EA to open trade on open of BAR[0] as soon as the conditions are met.
Corrected code:
Result:
Corrected code:
Result:
Right on point. Ooooh now i get it
Corrected code:
Result:
I have noticed the EA is showing me invalid stops on other instruments when backtesting on the strategy tester.
You must use normalized prices for Stop Loss and Take Profit. Use CSymbolInfo :: NormalizePrice method
An example is in the code iMACD Two Open , in the function 'OpenBuy'
So do i have to create another void function with a new normalized lot, sl and tp like this one in the example?
Or i simply have to do it like this?
Its still giving me invalid stops. The last EA i tried to code this is where i got stuck.
I have gone through iMACD Two Open and i have used CSymbolInfo.
Where exactly do i place the code to make this work.
Do we also not need to Normalize Bid and Ask?