[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 364

 
NICK_R:

Good day! Please help!

I want to write a function that would return the type of position opened based on Bid prices.

If some amount of Bid prices constantly goes up - type Bcu and vice versa.

I tried it myself, but it always returns 0.

Nikolay, it's very good that you are learning to program and create programs. But the thing is, you didn't exactly ask for help in some particular obscure case in the program, but you actually outlined the ToR for writing the program.

What you displayed, in my opinion, is metaphorically speaking in relation to robots, a pile of heterogeneous spare parts. It's not right at all.

So you can't point out a specific error here, as everything needs to be redone in a completely different way. - IMHO, I don't pretend to be more than that.

But that's no reason to get upset. Keep learning how to write. There, as they say, instead of you, of course, can "eat" (to do the job), but you yourself are not becoming well-fed from this (ie, do not learn). So go ahead. If one walks the other way, the path is traveled.

Try to write again with a different approach to the problem. - It worked for me.

 
lottamer:


I only see the EXPERT PROPERTIES in the Strategy Tester. I don't see the Expert Advisor settings. Where are they?

there's nothing like that in the properties. build 500

Dear sdfs! : ))) (of course, it's better to use a proper name in your account settings - it would be a bit more respectful to those whom you ask for help, with whom you communicate).

I've been somewhat incorrect - I stand corrected. By "Settings" I meant, of course, the EXPERT PROPERTIES. You're right about that - I stand corrected. Next is the Input Parameters tab. And here you'll see columns with names: "Start", "Step", "Stop". - These are the parameters you need.

 
Chiripaha:

Dear sdfs! : ))) (of course, it's better to use a proper name in your account settings - it would be a bit more respectful to those whom you're asking for help and with whom you're communicating)

I've been somewhat incorrect - I stand corrected. By "Settings" I meant, of course, the EXPERT PROPERTIES. You're right about that - I stand corrected. Next is the Input Parameters tab. And here you'll see columns with names: "Start", "Step", "Stop". - These are the parameters you need.



I thought the nickname was enough for the forum :))

Is this the window?

As you can see there is NO input parameters tab.

Only testing and optimisation.

 
lottamer:

I thought the nickname was enough for the forum :))

is this the window?

As you can see there is NO input parameters tab.

Only testing and optimisation.

Your picture didn't show up but you're right : )))) - It was easier to show a picture for you. - I stand corrected. (As you can see, I'm learning too... answer and help)


 
Chiripaha:

Your picture didn't show up, but you're right there too : ))) - It was easier to present a picture for you. - I stand corrected. (As you can see, I'm learning too... to respond and help)





and I have the exact same window, but WITHOUT the input parameters?

that's the point!

there are 2 lines in the expert

extern int STOP = 300;
extern int TAKE = 405;

so they must be in the properties window.

 

Here's what I noticed.

extern double TakeProfit = 50;
extern double Lots = 0.1;
extern double TrailingStop = 30;
extern double MACDOpenLevel=3;
extern double MACDCloseLevel=2;
extern double MATrendPeriod=26;

give a window with the optimisation parameters.

Mine... doesn't.

but I've got this one above.

#property copyright "Copyright 2012, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
#include <WinUser32.mqh>
#property show_confirm

#include <b-Positions.mqh>

I'm sensing something extra here...

 

I'VE GOT IT!

#include <b-Positions.mqh> - disables the input parameters tab!

Without this line the Expert Advisor stops working

what the hell?

 
lottamer:


and I have the exact same window, but WITHOUT the input parameters?

that's the point!

there are 2 lines in the Expert Advisor

extern int STOP = 300;
extern int TAKE = 405;

it means they should be in the properties window.

Oleg, be more compact. You and I will flood the forum with volumes.

The Expert Advisor, by definition, should have such a tab. Here... ...I experimented. I have removed all the external variables and the tab has indeed disappeared.

So, you've set something wrong with the external variables, that they are not displayed in the window. That is, mt4 does not see them as external variables. Or there may be other variants, but all around this essence.

You will not have such a tab, in this case, not only when testing, but also simply in the settings of the owl, if it is thrown on the chart.

 
lottamer:

FOUND IT!

#include <b-Positions.mqh> - disables the input parameters tab!!!

what the hell?

Well, there you go... : )) Congratulations on the resolution!

Only I don't quite understand here - why, all of a sudden, #include can disable external variables. - Let's search : )))

 
lottamer:

I'VE GOT IT!

#include <b-Positions.mqh> - disables the input parameters tab!

Without this line the Expert Advisor stops working

what the hell?


In file b-Positions.mqh comment out the line

#property library