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

 
RodionD:
Can you tell me how to determine if an order was opened a given number of BARs ago?
iBarShift(Symbol(),Period(),OrderOpenTime()) will return the bar open for the selected order at the current symbol, current timeframe. From there, do the math.
 

Good afternoon, everyone.

Is there such a script? You make one chart (one pair) with the required indicators, save it as a template and then scroll through the other pairs. This is not to load the computer.

 
Ale-xander:

Good afternoon, everyone.

Is there such a script? You make one chart (one pair) with the required indicators, save it as a template and then scroll through the other pairs. This is to avoid loading the computer.

There is a "TEMPLATES" indicator on the toolbar, you can save and load them there... The same can be done with the profile on the tab -file- and with the list of symbols ... right mouse button on the quotes ...

 

Afternoon,

Under Tools -> Settings -> Notifications there is an option to configure Push notifications. I can't figure out how to use them. If anyone understands how it can be useful, share plz :)

If it were possible to remotely control the Expert Advisor ... say, allow or forbid an Expert Advisor to trade ... that would be useful. Is there such a function?

Thank you.

 
Notter:

The toolbars have a "PATTERN" icon, where you can save and upload... You can do the same with the profile on the -file- tab and with the list of symbols ... right mouse button on the quotes ...


Maybe I explained it wrong. This is the standard I have. My view is that only one chart is open and the rest of the quotes are symbols
 

Hello! I am still making my first steps in MQL4 programming, so it is still difficult for me to translate my idea of writing a simple Expert Advisor that would open positions at break of a flat range into the program language. The idea is simple: we set nth bar of the flat range where the Expert Advisor recalculates the difference between high and low of each bar. The differences are summed up and divided by n bars. This gives the average value of differences of the range extemsems, let's call it the actual delta average. If its value is greater than 0 and less than that set in the settings of the external variable d, the Expert Advisor will place BuyStop and SellStop orders at the distance, L variable, from the range extrema. It is also important to specify in the EA settings a variable k that will limit the number of stop pairs set by the EA, as well as the Take Profit and StopLoss values.
The list of external variables of the Expert Advisor:
1) extern int n - number of range bars;
2) extern double d - required result of the sum of differences of the range bars extems divided by n range bars;
3) extern int L - distance in points between the range bars extems to the stop order placing by advisor;
4) extern int k - number of pairs of stop orders placed by advisor;
5) TakeProfit - profit value in points;
6) StopLoss - stop loss value in points.

7) Lot - size of lot.

Maybe, I haven't formulated the external variables correctly, so please correct me and don't judge me strictly. I would be sincerely grateful for help in writing the program algorithm.

 
BeerGod:

Did you use a ruler in the terminal or is there an indicator for this?

No, I looked with the MT4 crosshair and hovered with the cursor.
 
khrystuk:

Hello! I am still taking my first steps in MQL4 programming, therefore, I am still having difficulties in translating my idea of writing a simple EA that would open positions at breakage of a flat range into a program language. The idea is simple: we set nth bar of the flat range where the Expert Advisor recalculates the difference between high and low of each bar. The differences are summed up and divided by n bars. This gives the average value of differences of the range extemsems, let's call it the actual delta average. If its value is greater than 0 and less than that set in the settings of the external variable d, the Expert Advisor will place BuyStop and SellStop orders at the distance, L variable, from the range extrema. It is also important to specify in the EA settings a variable k that will limit the number of stop pairs set by the EA, as well as the Take Profit and StopLoss values.
The list of external variables of the Expert Advisor:
1) extern int n - number of bars of the range;
2) extern double d - required result of the sum of differences of the range bars, divided by n bars of the range;
3) extern int L - distance in points between extrema of the range bars to the level where the Stop order is placed by the Expert Advisor;
4) extern int k - number of pairs of stop orders placed by the Expert Advisor;
5) TakeProfit - value of profit in points;
6) StopLoss - value of StopLoss in points.

7) Lot - size of lot.

Maybe, I haven't formulated the external variables correctly, so please correct me and don't judge me strictly. I would be sincerely grateful for help in writing the program algorithm.

You start writing the code, and we'll go get beer and chips...

And when you will have questions about the code, you will get help. In the meantime... the opener needs to be found...

 
artmedia70:
In any case, for a pending order, the stop and take should be set relative to the price at which the order is set, not the Bid and Ask. Here is the order setting - relative to the Bid with Ask. And you need to check for StopLevel as well because it might be higher than you might expect at any moment and then your system will fail. Why not check and adjust. Laziness?


No. I just think unnecessary conditions and checks are a waste of resources.
 
artmedia70:

Start writing the code while we go out for a beer and chips...

When you have questions about the code, you'll get help. In the meantime... we still have to find the can opener...



Artem, you'd better drink juice like you did. I don't recommend beer... I don't recommend it... :)
Reason: