[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 954

 

Hello, could you please tell me why the expression 0.25+(-0.25) is not "0" but "-0".




	          
 
Greetings!

Help me make a simple condition. In the parameters I set the day of the week and the time from and to which trading will be true. Here is the code. I understand that the condition is not correct. Please help me to make it look right.

Parameters:

extern string StartTrade = "00:00";
extern string StopTrade = "06:00";
extern int StartDay = 1;

Execution of the condition:

if (TimeCurrent()>StrToTime(StartTrade) && TimeCurrent()<StrToTime(StopTrade) && DayOfWeek()==StartDay)
{
trade=true;
}
else
{
trading=false;
}

Thank you in advance!
 
143alex:
Still asking for help to finish. Changed a few lines... Buy trawls and closes perfectly, but Sell for some reason closes by itself immediately after opening, regardless of the LOSSELL line
Who will help?
 
Please help!!! I need a stop loss code to insert into my EA! I would be very grateful and happy!
 
kgn45:
Please help!!! I need a stop loss code to insert into my EA! I would be very grateful and happy!

There are a lot of variants to calculate.
 
143alex:
Hooray it seems to have worked!!! A trawl close function that does not depend on the expansion of the DC stops. (Don't judge the code too harshly... You can improve it )
Can't someone help me figure it out? Where are you? I need this code...
 
how to write code in an EA to understand the rebound from the level x.xx25
 
dimon74:

Hello, could you please tell me why the expression 0.25+(-0.25) is not "0" but "-0".


Because these are double numbers, they have a limited mantissa length and hence accuracy. Try this: NormalizeDouble(0.25+(-0.25),2)
 
35aleks:
how to write code in an EA to understand the rebound from the level x.xx25

Not interested in other levels?
 
Vinin:

There are many variants of calculation.
Stoploss is needed for an EA from the martingale class. any variant to put a stoploss on each order opened. I would be very grateful!