Forum

Time between 2 dates

Hello, Struggling here to get the time between to dates: Can you help please? Print ( "Date i=" ,Time[i], " Date ZZ4=" ,Time[ZZt[ 4 ]], " Date Diff=" ,Time[i]-Time[ZZt[ 4 ]]); // => Date i=2021.03.09 17:00:00 Date ZZ4=2021.03.04 18:00:00 Date Diff=1970.01.05 23:00:00 Print ( "Date i=" ,Time[i], "

How to scan Symbol, laod new symbol, and pause ?

Hello, This part scans some symbols void OnTimer () { if (FirstRun) { FirstRun= false ; Print ( "Changing Symbol" ); if ( Minute()== 00 || Minute()== 30 ){ ChartSetSymbolPeriod ( 0 ,Pair01, PERIOD_H1 );} if ( Minute()== 01 || Minute()== 31 ){ ChartSetSymbolPeriod ( 0

How to list into comment GlobalVariables

Hello, Please help to list some global variables into Comment(); I can Print, but I need to display names into Comment, the way it is coded only displays the first GlobalVar that it finds. void Get_GV_Name() { for ( int i= GlobalVariablesTotal ()- 1 ;i>= 0 ;i--) { string name=

How come Indi works only when compiling or Init?

Hello, please help me out to understand why the Indi works only when adding to the chart (Init) or when compiling code ? //+------------------------------------------------------------------+ //| TTF.mq4 |

Webrequest problem

Hi, Please help to solve problem while "webrequest=200 Too many requests" This function is too complicated for me. I only can code bots. I can't figure out what's wrong. It was working for years before. Not anymore : ( string GrabWeb() { string cookie= NULL ,headers; char post[],result[]; int

Expiration Date on Pending order

Hi, ‌ I wanted to use the expiration date on pending order . ‌ void openShortLimitTrade_RSI( double value) { // TrailingStopDistance int ticket = OrderSend ( Symbol (), OP_SELLLIMIT ,Lots,value,slippage, 0 , 0 , "RSI_EA" ,MagicNumber2, TimeCurrent ()+ 60 * 60 ,Red); PlaySound ( "alert.wav" );

Problem with declaration without type

Hi, Why when I tried to copy something working into another EA‌... It doesn't work. ‌ Please Help.‌ ‌ It says 'SplitString' and 'ArraySize' - declaration without type. But it is coded like this into many EAs. int init() ‌ SplitString(PipsDeclencheur, ";" , PipsDeclencheurArray);

EA stops to run.

Hi, I have noticed that I have an old EA that sometimes stops to run. I mean I have to click compile button again so EA refreshes and restarts to run. After days it will kinda freeze again for sure. What can I do? Should I replace void_Start() by void OnTick() ??? Please help

Date Variables problem.

Hi, I have 1 variable times created this way: (picture attached) I need to calculated the time between now and the last time a news time came out. when I do this way... it works nicely: Print (( TimeGMT () - GV_FxCal_News1)/ 60 ); => I got the time in minutes. This is working from the EA which

Problem with variables not created

Hello, Please help me to correct the error. EA doesn't create variables called: GV_xAPI_Long_ GlobalVariableSet ( "GV_xAPI_Long_" +name, StringToDouble (longps)); It prints Outlook has been refresh!... but I don't see them. Also it prints: Function is not confirmed. What function? I don't