[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 330
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
Guys, a hint... I am showing you code fragments where market entry conditions are calculated. WHY with the given values of timeframes obtained during optimization
i.e. the TF = daytime, the market entry happens at the opening of 4-hour candlesticks, in the strategy tester, when tested on the period H4? There should be an entry ONLY at the opening of the day candles - I give a code and report sections for testing on H4 and D1, Expert Advisor with control of a new bar opening.
Reports. When testing on H4 - entry into the market every 4 hours, if trading conditions are fulfilled, thoughextern int s_signal_period =7;
extern int t_trend_period =7;
D1 - testing on D1 - entering the market at the opening of D1, at the sameextern int s_signal_period=7;
extern int t_trend_period =7;
This is supposed to be so... Why does the strategy tester enter the market at the H4 open when testing on H4, but not at the opening of daily candlesticks? becauses_signal_period=7;
extern int t_trend_period =7;
Thanks for the tip on this issue.
Guys, a hint... I am showing you code fragments where market entry conditions are calculated. WHY with the given values of timeframes obtained during optimization
i.e. the TF = daytime, the market entry happens at the opening of 4-hour candlesticks, in the strategy tester, when tested on the period H4? There should be an entry ONLY at the opening of the day candles - I bring sections of the code and test report on H4 and D1, Expert Advisor with control of the opening of a new bar.
Reports. When testing on H4 - entry into the market every 4 hours, if trading conditions are fulfilled, thoughextern int s_signal_period =7;
extern int t_trend_period =7;
D1 - testing on D1 - entering the market at the opening of D1, at the sameextern int s_signal_period=7;
extern int t_trend_period =7;
This is supposed to be so... Why does the strategy tester enter the market at the H4 open when testing on H4, but not at the opening of daily candlesticks? becauses_signal_period=7;
extern int t_trend_period =7;
Thanks for the tip on this issue.
The code given is not sufficient to answer
The code given is not enough to answer
How much code do you need? The signal part is there...
The given code is not enough to answer
Now I tested it on H1 - it opens trades every hour with s_signal_period=7;
extern t_trend_period =7;
Now tested on H1 - opens trades every hour with s_signal_period=7;
extern int t_trend_period =7;
It makes sense to make the signal_period variable global and assign a value to it in init()
And change the control for a new bar
It makes sense to make the signal_period variable global and assign a value to it in init()
And change the control of the new bar
I see, Victor, thank you - I will try it tonight after work. I will write to this thread with the results.
any tips on how to know if an order catches a loss or not?
Think right.
Search: detect losing trade site :mql4.com, search for losing trade site :mql4.com
How do I know if an order has caught a loss or not?
If OrderClosePrice()==OrderStopLoss(), then the order is definitely closed on a loss order. The trick is in the area of which profit it was closed. Let us say, the trader has opened a position, set a stop loss, and then, when the position has moved to profit, he/she has moved the stop loss to a positive profit zone - so, if the stop triggered, the order will be closed with profit. The price won back and knocked the order down by the stop. That is, the OrderClosePrice() is really equal to OrderStopLoss(). The ORDER Caught a Moose, but it did not show a loss, but a profit. What do you do in this situation?
Hello!
Can you tell me how to calculate the lot size, depending on the entry price, StopLoss and percentage of the deposit? Let's assume the entry price is 1.4500, StopLoss is 1.4400. The risk is 100 pips. If the price of a pip is 0.1 and the risk is 2% of the balance (10000) the lot size would be 0.2. Is it possible to deduce this formula in MQL? I searched almost the entire forum and could not find anything like that. All other methods for lot calculation are completely different.
Thank you.