Ask! - page 81

 
Flytox:
I dont understand how we can declare and initialise a bool variable and assign to it an integer variable int the next line

//example

bool BuyFilter = false;

BuyFilter = ( Close[1]>iMA(NULL,0,FilterPeriod,0,MODE_EMA,0,1));

Could someone enlight please.

Thanks

Edit: ND, i'don't know if it is the good place to post this.

BuyFilter is assigned to a boolean: the result of the test "Close[1] > iMA(NULL,0,FilterPeriod,0,MODE_EMA,0,1)".

For example, you can write " bool mybool = 1 < 0; ", its equivalent as " bool mybool = false;"

 

thank a lot michel, i didn't catch the (>) sign. I understand better and thank you for that. just another related question:

// - BUY

if

(

BuyFilter

&&

line0long-line1long>DeltaLong*point

&&

line1long>0

&&

prevtrendlong < 0

//|| prevtrend2 < 0)

) TradeSignal= 1;

BuyFilter here is true or false? Because if it is true (when ommitted) i don't understand the logic behind the"buy" conditions of this EA.

Thanks for your help.

 
Flytox:
thank a lot michel, i didn't catch the (>) sign. I understand better and thank you for that. just another related question:
// - BUY

if

(

BuyFilter

&&

line0long-line1long>DeltaLong*point

&&

line1long>0

&&

prevtrendlong < 0

//|| prevtrend2 < 0)

) TradeSignal= 1;

BuyFilter here is true or false? Because if it is true (when ommitted) i don't understand the logic behind the"buy" conditions of this EA.

Thanks for your help.

I do not know the wole EA, but probably BuyFilter is sometime true (if Close[1] > iMA(NULL,0,FilterPeriod,0,MODE_EMA,0,1)), sometime false (if Close[1] <= iMA(NULL,0,FilterPeriod,0,MODE_EMA,0,1)).

When all the 4 sub-conditions are true simultaneously (use of "&&" operator, ie "and"), a recapitulating signal is genered by the assignement of 1 to the variable "TradeSignal"; More than probalby this information will be checked later.

So, Close[1] must be > iMA(NULL,0,FilterPeriod,0,MODE_EMA,0,1), AND line0long-line1long must be > DeltaLong*point, AND line1long must be > 0 AND prevtrendlong must be < 0;

 

Thank for all Michel, this EA seems now clear and clear, thanks again.

 

Question to Codersguru.

How can I program that my EA is always received around GMT 20 o'clock an order?

Please help me.

Thanks more fxbeginner

 

please help me

I have (ea) with lots 1,2,3,4...

but I want lots like 1.1,1.2,1.3,1.4,1.5

the code is

double subLotSize()

{

double lotMM = MathCeil(AccountBalance() * Risk / 1000)/40;

if(AccountIsMicro==false) //normal account

{

if(lotMM < 0.1) lotMM = Lots;

if((lotMM > 0.5) && (lotMM < 1)) lotMM = 0.5;

if(lotMM > 0.1) lotMM = MathCeil(lotMM);

if(lotMM > 100) lotMM = 100;

}

else //micro account

{

if(lotMM < 0.01) lotMM = Lots;

if(lotMM > 0.1) lotMM = MathCeil(lotMM);

if(lotMM > 100) lotMM = 100;

}

return (lotMM);

I don't speak english good, sorry for this...

 

Email function

Hi Codersguru.

You have helped me before, now I need to pester you again.

I'm the one thats partially sighted - and its getting worse. I'm desperate to have the e-mail function attached to the indicators below.

Someone has had a go at attching it to the Slope indicator, but it didn't work.

I really would be very grateful if you could do this for me.

Tickwatcher

 

How to make EA ----synchronization system

I have a thought:make EA called synchronization system.

I have 3 accounts:When I open/close position on an account,I want other 2 accounts immediately do the same automaticly,This must done by 2 EAne run on source account,write the orders in the file.and the other run on destination account,read the orders from the file.

How to make it?thank you!

 

Hi CODEGURU,

I am zero is MQ4, Is there are simple program to give sound alter when to lines cross over both upwards and downward for JMA (5, 15) I need an indicator and a sound alter when 5JMA cross 15 JMA upwards and downwards.

As I said I am zero so I don't know where to begin?

Any help is appreciated.

Thanks

MJ

 

Help!

Am using this indicator with good success rate but would like to make the

following change and am new to coding....modify multi info indicators to give an alarm sound,when trend pass a setting number(adjustable) and hold a certain time (also adjustable),for example sell >75% or buy >75% and hold 15 minute give an alarm sound.

Any help would be appreciated.