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

 
Techno:
I don't mean a test chart, but a chart of quotes, roughly, what changes in openings, closings?
I'm sorry, I don't understand the question... Probably due to my inexperience in the depths of MT4
 
IgorM:

there must be an error in the conditions / logic
Since MetaEditor doesn't have a debugger, this is what I do:

add at the end of the code

Comment( "flag= ", flag, " PrevFlag=", PrevFlag, ......);

return(0);

}

and in the visualization mode in the tester at low speed check what changes and what doesn't

Thanks, that's really better. the variables don't change! So there's no condition to enter... I'll keep looking.
 

Here is an interesting (for me of course ;)) problem-question:

Is it possible to make it so that when closing a position at trailing stop (position at profit) or at take profit, before closing this position to find a losing position, which has a loss in absolute value less than the profit of the profitable position being closed, to close it first, and then the profitable one. Is it possible?

 
artmedia70:

Here is an interesting (for me of course ;)) problem-question:

Is it possible to make it so that when closing a position at trailing stop (position at profit) or at take profit, before closing this position to find a losing position, which has a loss in absolute value less than the profit of the profitable position being closed, to close it first, and then the profitable one. Is it possible?


I think you should write a function that will search through all orders by magic, put their profit into an array and then trivial sorting of the array will give you the required data
 
IgorM:

I think you have to write a function that will search all orders by magician, put their profit into array, and then the array sorting will give you the data you need.

Oooh... how messed up it is... Igor, you know I haven't made friends with arrays yet... :)

Although, as I understand it...

 
artmedia70:

Oooh... how messed up it is... Igor, you know I haven't made friends with arrays yet... :)

I'll have to, though...


Arrays? How hard can it be? It's simpler than a variable! First, start with an array that's limited in the number of elements - a static array, and you'll learn about dynamic ones later

and think of them as having lots of variables, but with an index, like this

double mas[100] ;

and if you haven't worked with arrays, read as double mas1,mas2,mas3............

and then following the logic - zero the array, in the loop - i.e. initialize it, then put all your profits into the loop, then sort the array and finally in the first element mas[0] you will get maximum or minimum (depending on how you sorted) value of profit

 
artmedia70:
Sorry, I didn't understand the question... Probably due to my inexperience in the depths of MT4
Artem, you are being hinted at for the second time that life is boiling on the symbol chart and the tester report does not give the real picture and is often misleading. Open the chart after the end of the test and walk through each trade with a magnifying glass. You will discover a lot of interesting things.
 
I've been struggling for a week, but I can't implement it" I need to open two buy and sell orders after 3 losing orders. I need help, I just can't get it to work!
 
granit77:
Artem, you are being hinted at secondary that life is boiling on the symbol chart and the tester report does not give the real picture and is often misleading. Open the chart after the end of the test and walk through each trade with a magnifying glass. You will discover a lot of interesting things.

Victor, I am running the test ONLY with visualization. I see every trade with all the indicators. I pause and see what, where, how and why. If necessary, I open a new window of the same symbol, put the required indicators, enter the required date and look at the deal under all angles, if necessary, mark the point of the deal and move to another timeframe, to see the indices reading I read from the higher TF... If I see a discrepancy with the algorithm - I go straight to MetaEditor and look for algorithmic errors... Therefore at the initial stage of testing I kill a lot of bugs, and after that... ...I get a lot of nonsense, so I ask experienced folks...
Or are there more accessible and obvious methods of visual analysis?
 
Top2n:
I tried to use it for a week, but I failed to realize it. " I should place two buy and sell orders after 3 losing orders. Help me, I just can't get it to work!

Using Igor Kim's functions, it's quite realistic...

We define a variable, let's say double LossPose=0;

Then on every tick, we call the function that signals the loss of the last closed position. If it is true, then LossPose++;

If LossPose>=3 {open necessary positions}...

Enclosed is a complete list in Excel of useful functions written by Igor with descriptions and references to the source...

Files: