[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 4

 
merkulov.artem:

Please advise how to use OrderModify() to modify a pending order, if for example the opening price has not changed, but takeprofit and stoploss have. i.e. the question is how to leave some parameters unchanged and change others. When i call getlasterror() either no error or code 1(unknown result) or nothing happens.

thanks for the tips!

see here - page 106... The modification conditions are your own, the approach is the same - there are conditions when the price changes, you have stop values.
Files:
52_ft140909.rar  4021 kb
 

Again, may I?

I'm trying to trace by ZigZag extremums... I found something on the forum, but it still doesn't work (in the tester). The reason is in inexperienced work with ZigZag buffers... I must be missing something. I used two types of ZigZag. CZigZag with one buffer that stores information on extrema and ZigZag with MT4 with 3 buffers. I tried to use Alert to view the array values but it always contains zeros.

To fill the buffer I used:

CZigZag:Z[i]=iCustom(NULL,0, "ZigZag",ExtDepth,ExtDeviation,0,i); Alert("Z",i," = ",Z[i]);

ZigZag(upper extrema): Z[i]=iCustom(NULL,0, "ZigZag",ExtDepth,ExtDeviation,1,i); Alert("Z",i," = ",Z[i]);

ZigZag(lower extrema): Z[i]=iCustom(NULL,0, "ZigZag",ExtDepth,ExtDeviation,2,i); Alert("Z",i," = ",Z[i]);

 
Please advise what can it be, I am running in the tester, orders are opening and closing normally. I put optimization to choose a parameter, I am running all the results are rejected, but if I change this parameter manually in the test, everything is OK.
 

granit77:

granit77, please help. I wrote an EA and tested it several times, looking for the best strategies. During next testing something happened and EA started to give me a "waiting for update" message on each test attempt. I tried to reload the historical data but it crashes. Moreover, during reloading the extended charts of quotes the last week's data disappear. I tried to restart the program, but historical data is not loaded. What can I do in this situation ? :)



 
T-G:
Please advise what could be wrong, when I run in the tester, orders are opened and closed, everything is normal. When I put optimization I choose a parameter and run all the results are rejected, when I manually change this parameter in the test, everything is normal.


Before optimization uncheck all options in the tab: Expert properties - Optimization - Restrictions (uncheck all options).

In addition, when I click on the tab: Optimization cut - uncheck - skip useless results.

 
boris.45:

It's hard to say. There are a lot of subtleties. Maybe someone knows better and can tell you, but I would prefer to put a clean terminal and copy my codes into it. And, if the terminal is for testing, only the required Expert Advisors/indicators should be installed. And of course check for viruses.
It is possible to find a glitch, but it will be faster and cleaner. We don't want to get in the way, we want to drive.
 
Roman.:


before optimisation uncheck all checkboxes in tab: expert properties - optimisation - restrictions (uncheck all checkboxes).

In addition, if you click on the tab: Optimise - uncheck - skip useless results.

Only they differ from simple run. For example, the parameter x=1 just for test results in 500 trades, x=2 results in 700 trades. i optimise this parameter and x=1 now gives 1 trade, x=2 also gives 1... EA uses virtual graphic modification, may be this is the reason? like graphic object is not created during optimization?
 
T-G:
I unchecked "skip useless results" and the results appear. Only they differ from simple run. For example, with the parameter x=1 simple test gets for example 500 deals, with x=2 - 700 deals. I start to optimize this parameter and x=1 - now gives 1 deal, x=2 also gives 1 deal... EA uses virtual graphical modification, may be this is the case? like during optimization no graphical object is created?

I don't know what it is. It may be. Although, if the test - everything is as it should be, in theory, the optimization should work as it should be...
 
Roman.:

I don't know about that... It's possible. Although, if the test - everything shows as it should, in theory, the optimization should work as it should...
In theory, yes, but the test specifically ran the parameter x=1, then the parameter x=2, then take the optimization of x from 1 to 2 step 1. all restrictions are unchecked, skipping useless cuts, too. genetic algorithm on and off. the results of the optimization tests differ, helppp!
 



I have my own strategy, but my emotions prevented me from using it. The only solution was to write a trading robot. Today I seem to be able to do it, but I hit a stop and I don't understand how to solve the problem.

I have a problem with this, the system opens orders + pending orders, and they both work sell and buy, with the opening of a new market it opens with two pending orders, like a Martin, close at take or loss, in any case, when the opposite signal to the previous remain active and open new opposite.I can't decide how to delete pending orders when market order triggers, my book says something about Magic Numbers and Ticket, but I can't figure out how to recognize an order to close the pending orders.

Reason: