Makar, stop messing with the man's head. He only needs the global level variable and the current price.
inputint Points = 30;
double LoU;
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
if(Bid-LoU >= Points*_Point)
{
OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"300",0);
Print("---------------------КАЖДЫЙ ТИК ------Tick---------= " , Tick);
LoU = Bid; // Здесь вместо Bid можно поставить любую цену
}
}
Thus, on each tick the difference of the current price and the price in the LoU variable will be checked and if this difference is equal or exceeds 30 points - the condition is fulfilled, the LoU variable will take a new value and the difference will be checked with a different value.
There is a subtlety here. First set the size and then reset to zero to release the fixation, which does not change the size. There is no other way around this.
Makar, stop messing with the man's head. The global level variable and the current price are enough for him.
So, on every tick the difference of the current price and the price in LoU variable will be checked and if this difference is equal or exceeds 30 points - the condition is fulfilled, the LoU variable will take a new value and the difference will be checked with a different value.
You're wrong radically.... Thanks to Makar, I have significantly and most importantly, very effectively broadened my horizons in forex. If not for him I don't know when I would have learned so many useful things for me. I wish there were more of such "managers" on this forum. It was him, and not someone else, who told me that the solution to my problem is the use of EventSetTimer(60) I am very grateful to him for quick and high quality informational support.
And what you advise, I knew it a long time ago and in my code your advice is present from the beginning.
2021.05.2006:30:45.176 GBPUSD,M1: 52255 tick events (1440 bars, 53255 bar states) processed in0:00:00.000 (total time 0:00:05.906)
2021.05.2006:30:45.1632010.01.0400:00:00 ×ÈÑÒÛÉ inputs: Points=30;
2021.05.2006:30:45.145 TestGenerator: spread set to 22021.05.2006:30:45.145 TestGenerator: no connect to trade server, default environment will be applied
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I signed it.
Makar, stop messing with the man's head. He only needs the global level variable and the current price.
Thus, on each tick the difference of the current price and the price in the LoU variable will be checked and if this difference is equal or exceeds 30 points - the condition is fulfilled, the LoU variable will take a new value and the difference will be checked with a different value.
Here's your code.
But for some reason it doesn't open any orders.
It's opening for me. Check what the log says.
Good day!
I am creating an indicator in a separate window. I want to set the initial height of the window, for example 100
We have a standard function:
But they block user height changing, it always stays 100(((( And I really need to be able to change it manually afterwards
Any other options?) So far, I found a wayto simulate throughWinAPI, that we stretch the window with the mouse (and I'm not sure what I can do)
Make it so:
Good day!
Just delete
Makar, stop messing with the man's head. The global level variable and the current price are enough for him.
So, on every tick the difference of the current price and the price in LoU variable will be checked and if this difference is equal or exceeds 30 points - the condition is fulfilled, the LoU variable will take a new value and the difference will be checked with a different value.
You're wrong radically.... Thanks to Makar, I have significantly and most importantly, very effectively broadened my horizons in forex. If not for him I don't know when I would have learned so many useful things for me. I wish there were more of such "managers" on this forum. It was him, and not someone else, who told me that the solution to my problem is the use of EventSetTimer(60) I am very grateful to him for quick and high quality informational support.
And what you advise, I knew it a long time ago and in my code your advice is present from the beginning.Makar, stop messing with the man's head. The global level variable and the current price are enough for him.
You never read the topic first and advise what has already been passed
You never read the topic first and advise what's already been done
Agree with you 100%.... no offence to Alexei.....
It works for me. Check what the log says