F
> what is been saved in a variable
Which variable?
Might be quicker to ask whoever coded this to confirm the intended strategy?
-BB-
F
> what is been saved in a variable
Which variable?
Might be quicker to ask whoever coded this to confirm the intended strategy?
-BB-
I don't know what you mean?
Anyway I added the compleet code.
At line 288 the the rules of the EA begin.
After a quick read through this amount of code...
I would say the problem is that piviot_low_hit is declared and initialized (i.e. as false) every tick but is only set to true on a new bar
FWIW
-BB-
After a quick read through this amount of code...
I would say the problem is that piviot_low_hit is declared and initialized (i.e. as false) every tick but is only set to true on a new bar
FWIW
-BB-
Well for the first rule it must check everything when a new bar opens as soon as everything is ok for rule1 I set the piviot_low_hit on true.
And also it sets the price of the lower low of bar 5 in the variable price_low_5.
After that it needs to wait until the current price crossed the price in the variable price_low_5.
When that happens it needs to open a SELL. And it will reset the piviot_low_hit to false.
I also edited the code a little bit so it will reset piviot_low_hit back to false, I forget that :p
> And it will reset the piviot_low_hit to false.
Thats needed but is not the basic problem which remains that piviot_low_hit is set to false by being declared every tick and hence is false until the first tick of the new bar and is only true for the first tick of that new bar
-BB-
> And it will reset the piviot_low_hit to false.
Thats needed but is not the basic problem which remains that piviot_low_hit is set to false by being declared every tick and hence is false until the first tick of the new bar and is only true for the first tick of that new bar
-BB-
I don't agree with you about that.
Because piviot_low_hit will be true until the sell order has been started. When this is done piviot_low_hit will be set on false.
Can you maybe edit the code as you think it must be? Or someone else :p
So declare the variable up with the other statics at the top of the EA, prior to the init() function
-BB-
So declare the variable up with the other statics at the top of the EA, prior to the init() function
-BB-
& u have to take care
void reset() { bool piviot_low_hit = false; }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everybody,
I'm making a EA atm but I have a small problem and I can't figure it out where the problem is.
The is EA working with a two rules and the second rule is that it must wait until the current price has crossed a price in the history what is been saved in a variable.
But the EA isn't doing that I doesn't wait until the current price has crossed the price in the history but opens the trade when the first rule is met and opens then a trade when a new bar has been opened. But the chance that the opening bar is the crossing of the price in history is 1%. So the EA should open a trade somewhere in a bar.