Download MetaTrader 5
To add comments, please log in or register
What is MetaQuotes ID? Find that out from the article!
braianh
8
braianh 2016.06.19 18:49 
Hi.

Why this simple code (attached) doesn't work with takeproft and stoploss below 7 pips?

Files:
test_1.mq4 3 kb
Fernando Carreiro
1456
Fernando Carreiro 2016.06.19 19:00  

Your statement "doesn't work", has no meaning for us because it does not explain what your exact difficulty is with your code.

Also, the code attached was originally produced by a Code Generator. We do not support the use of code generators here because they produce very bad code.

The fact that you used a code generator, tells us that you do not have the required knowledge to build your own EA or to even be able to understand the basics of what we might suggest to you, in order to fix your problem.

So please, learn to write your own code (see Documentation and Book), or if unable to, hire someone at the Freelance section to code it for you.

PS! Also, learn about STOP-LEVEL and FREEZE-LEVEL, conditions which are set by your broker that affect the placement and minimum sizes for Stop-Loss and Take-Profit.

braianh
8
braianh 2016.06.19 19:45  
FMIC:

Your statement "doesn't work", has no meaning for us because it does not explain what your exact difficulty is with your code.

Also, the code attached was originally produced by a Code Generator. We do not support the use of code generators here because they produce very bad code.

The fact that you used a code generator, tells us that you do not have the required knowledge to build your own EA or to even be able to understand the basics of what we might suggest to you, in order to fix your problem.

So please, learn to write your own code (see Documentation and Book), or if unable to, hire someone at the Freelance section to code it for you.

PS! Also, learn about STOP-LEVEL and FREEZE-LEVEL, conditions which are set by your broker that affect the placement and minimum sizes for Stop-Loss and Take-Profit.


I am already learning, but the Code Generator was my first contact, and it did not work very well. So, i am trying to fix it myself. But to me, the code is OK. So I came here.

What I was truing to say is that the robot dont set the the TakeProfit < 7 on a trade, but if I set in the code TakeProfit=10 for exemple, it works perfectly.
the same with StopLoss.
Fernando Carreiro
1456
Fernando Carreiro 2016.06.19 21:54  
braianh:

What I was truing to sayis that the robot dont set the the TakeProfit < 7 on a trade, but if Iset in the code TakeProfit=10 for exemple, it works perfectly.
the same with StopLoss.

I have already replied to that question - learn about STOP-LEVEL and FREEZE-LEVEL, conditions which are set by your broker that affect the placement and minimum sizes for Stop-Loss and Take-Profit.

For example, if I trade the AUD/CAD currency pair on RoboForex's Pro-Standard (non-ECN account), the minimum stop size (also known as STOP-LEVEL), is 8 pips.

So, look at your broker's Contract Specifications to see what the minimum stop size is for the currency pair you were using. It is probably 7 pips and that will explain your problem.

Before setting a Stop-Loss or a Take Profit you should always take into account the values of "MarketInfo( _Symbol, MODE_STOPLEVEL )" and "MarketInfo( _Symbol, MODE_FREEZELEVEL )".

/
To add comments, please log in or register