[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 702
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
static int time = Time[0];
if (time < Time[0]){
// old candle
} else {
// new candle
time = Time[0];
}
Now the trades are half as long as they were before
Instead of checking for a new bar, just pause between openings, set in seconds:
I check it this way (in bold, ignore /*PauseMain*/ - it's a random value of delay in minutes - from 5 to 9):
// Тут начало функции открытия позиций (открытие Buy).... // Ниже код открытия Sell: PauseMain51=random(5,9)*60; if (!Lot()) return; // Средств не хватает на миним.- выходим if (!OpnSell51 || !Trade) return; if (ExistPositions(NULL, OP_SELL, 51, 0)) // Если есть такой же открытый Sell { if (SecondsAfterOpenLastPos(NULL, OP_SELL, 51)<=/* PauseMain51*/ 7*60) return; (7*60 сек = 7 минут) // Если прошло мало времени - валим } //---------------------- Позиции ещё нету - открываемся...----------------------------- divider=1; Lots=GetSizeLot(); Magic=51; // Задаём магик... 5 и 1; 5 = пять минут, 1 = стратегия 1 New_Comm="Sell_M5_Стратегия_1_Основная позиция"; // Задаём комментарий для позиции Lots_New=NormalizeLot(Lots/divider, False, NULL); OpenPosition(NULL,OP_SELL,Lots_New,0,pb-tp*po,Magic,New_Comm); return;I hope it makes sense...
Boris, small correction in the code, forgot to add a reset of the array position, when returning to the original lot:
THANK YOU VERY MUCH! Everything worked out. Goes well and puts the right lots!!!
How can I change or add something to the code to set the bar width in the histogram?
in indicator settings - line type, colour and width/thickness
in the indicator settings - line type, colour and thickness/width
SetIndexStyle(1, DRAW_LINE,EMPTY);
SetIndexStyle(2, DRAW_NONE);
SetIndexStyle(3, DRAW_NONE);
SetIndexStyle(4, DRAW_NONE);
it's here ....... but my tool has a line width of 0 and I want to set the width of 2 so I don't have to deal with settings ...... I don't know how to do it .... I'm not a programmer .... help me please ))))
I don't know anything about programming at all. I wanted to make CCI Filter (https://www.forex-tsd.com/indicators-metatrader-4/3356-cci-filter.html) the same for WPR, changed CCI to WPR and changed levels in coloring conditions of bars (not -100, 0, 100 like CCI, but -60, -50 and -40, because in MT WPR has range -100 to 0, I think, right?) But for some reason it compiles with an error, and the screen shows a monochrome indicator. What is wrong? Thanks in advance
Memory is useless).
I want to know what kind of currency, prescribed the variables
string EUR="EURUSD";
string GBP="GBPUSD";
string symbl = "";
I write the following at start :
symbl = symbl(); //receive the value of the symbol
I want to compare the received value of symbl with the values of my variables, and if they match, then make a decision.
switch (symbl) {
case .......... then nothing happens (( break;
case ................ break;
}
Refresh my memory))
I figured out that only a character constant can be used, but how do I do it?
Memory is useless).
I want to know what kind of currency, prescribed the variables
string EUR="EURUSD";
string GBP="GBPUSD";
string symbl = "";
I write the following at start :
symbl = symbl(); //receive the value of the symbol
I want to compare the received value of symbl with the values of my variables, and if they match, then make a decision.
switch (symbl) {
case .......... then nothing happens (( break;
case ................ break;
}
Refresh your memory ))