How to code? - page 130

 

could some one please let me know why this EA is not opening sell orders.

or reversing positions ie buy when buysig sell when sellsig

I think I have push the right buttons.

At the moment it only buys

Cheers

Beno

Files:
pivot_ea2.mq4  10 kb
 

Using Bool statement

In my setup I use:

extern Bool Show_Settings=True;[/PHP]

//Then in coding I use:

if(Show_Settings==true) subPrintDetails();

//Later in Coding I use:

void subPrintDetails()

[PHP]{

void subPrintDetails()

string sComment = "";

string sp = "----------------------------------------\n";

string NL = "\n";

sComment = sComment + " "+NL;

sComment = sComment + "RSI1 = " + DoubleToStr(RSI1,Digits) + NL;

sComment = sComment + "RSI1_1 = " + DoubleToStr(RSI1_1,Digits) + NL;

Comment(sComment);

return;

}

When I change the bool setting to false, the comments still show. If I reboot the program, the comments do not show??? How can I fix this where I can toggle back and forth the comment display in the expert setup window??

David

 
G-Man:
Hi guys,

I would appreciate it if someone can tell me how to identify the oldest orders within an EA to enable them to be closed.

Many thanks,

G-Man

Normally the first running orders is the oldest.

OrderSelect(0, SELECT_BY_POS, MODE_TRADES);

Try on backtest 1st to be sure that the oldest running order.

 

hi there, i'm new here

anyone could please help me how to filter repainted indicator?

isn't out there have sell book for programming?

i want to learn

 
forexjunior:
hi there, i'm new here

anyone could please help me how to filter repainted indicator?

isn't out there have sell book for programming?

i want to learn

This is free https://www.mql5.com/en/forum/178427

 

Read and Write Data in file seperate from mq4 terminal?

Is it possible to Read and Write Data in file seperate from mq4 terminal?

This aspect of programming is new to me. I want to write (from an Expert) to a file not in my mq4 terminal. I then would like to import from the file back into my mq4 terminal. Is this possible?

I would greatly appreciate anyone helping me, or at least pointing me in the right direction.

-wolfe

 
wolfe:
Is it possible to Read and Write Data in file seperate from mq4 terminal?

This aspect of programming is new to me. I want to write (from an Expert) to a file not in my mq4 terminal. I then would like to import from the file back into my mq4 terminal. Is this possible?

I would greatly appreciate anyone helping me, or at least pointing me in the right direction.

-wolfe

I think yes it's possible but I don't know how, at least to import.

There are some files like this one or this one that write a file as CSV.

I remembersome discussionabout the code. In a few words: to where write the file. Key is FILE_WRITE.

More links:

https://www.mql5.com/en/forum/175496

https://www.mql5.com/en/forum/general

https://www.mql5.com/en/forum/177814

 
Linuxser:
I think yes it's possible but I don't know how, at least to import.

There are some files like this one or this one that write a file as CSV.

I remembersome discussionabout the code. In a few words: to where write the file. Key is FILE_WRITE.

More links:

https://www.mql5.com/en/forum/175496

https://www.mql5.com/en/forum/general

https://www.mql5.com/en/forum/177814

Thank you Linuxser,

I will check out the links you provided. I appreciate your help. Anyone else with information on the subject would also be welcomed.

 

thankz linuxser

 
Dave137:
In my setup I use:
extern Bool Show_Settings=True;[/PHP]

//Then in coding I use:

if(Show_Settings==true) subPrintDetails();

//Later in Coding I use:

void subPrintDetails()

[PHP]{

void subPrintDetails()

string sComment = "";

string sp = "----------------------------------------\n";

string NL = "\n";

sComment = sComment + " "+NL;

sComment = sComment + "RSI1 = " + DoubleToStr(RSI1,Digits) + NL;

sComment = sComment + "RSI1_1 = " + DoubleToStr(RSI1_1,Digits) + NL;

Comment(sComment);

return;

}

When I change the bool setting to false, the comments still show. If I reboot the program, the comments do not show??? How can I fix this where I can toggle back and forth the comment display in the expert setup window??

David

Modify like this:

if(Show_Settings) subPrintDetails(); else Comment("");

FerruFx

Reason: