[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 332

 
My friends, here on the site was laid out for free download a wonderful indicator that shows the history of trading on the chart of a currency pair, ie, each completed transaction is reflected either a line or a rectangle on the chart with an indication of entry point and exit point (and perhaps even the amount of gain/loss). I've seen it, but now I can't find it. Perhaps someone has it at hand, drop the szilichka pliz....;-) Thank you all in advance.
 
Hi all !!! I have a buy order with 0.01 lot and a sell order below the buy, with a sell volume of 0.03, how to calculate the profit for the sell so that both positions would close at zero ????
 
VOLDEMAR:
Hi all !!! Question is buy with 0.01 lot and sell order below the buy, sell with 0.03 lot how to calculate the profit for the sell so that both positions would close at zero ????
The profit is enough to compare https://docs.mql4.com/ru/trading/OrderProfit if necessary to add commissions.
 
Or alternatively do not calculate levels, do not calculate profits, and just do monitoring. If only two orders are planned in the entire terminal, then as soon as the account balance reaches the amount of money in "Funds", give a command to close all orders. If more orders are planned but we need to track the profit only for these two orders, we need to track OrderProfit() of the first order + OrderProfit() of the second order. If this value is more than or equal to zero, we close these two orders. At this, we can also consider the swaps of the orders.
 
although if one wants to put TP/Sl for orders at once, the task becomes somewhat different.
 
Zhunko:
This is useless. The log file is filled in after the MT4 upload or when MT4 has time to do so.
From my observations it's almost second-to-second. The matter is not even the speed of transferring data from log, but the ability to fix connection failures, requesters and other nonsense. Have you tried it? Maybe there are ready-made solutions somewhere?
 
VOLDEMAR:
Hi all !!! Hi, I have a Buy order with 0.01 lot and a Sell order, which is lower than the Buy one, and a Sell order with 0.03 lot, how to calculate the profit for a Sell, for both positions to be closed in zero ????

StopLoss bey = (Village price - Order distance - spread)/(1-0.01/0.03)

Take Sell = StopLoss point - spread

 
drknn:
Or alternatively do not calculate levels, do not calculate profits, and just do monitoring. If only two orders are planned in the entire terminal, then as soon as the account balance reaches the amount of money in "Funds", give a command to close all orders. If more orders are planned but we need to track the profit only for these two orders, we need to track OrderProfit() of the first order + OrderProfit() of the second order. If this value is more than or equal to zero, we close these two orders. At this, we can also consider the swaps of the orders.
And commissions. But if the quality of connection with a broker or an Internet connection leaves much to be desired, then it is better to immediately set stops and takei.
 

Can you advise how to implement it in code - there is a parameter I need to add it to a file with a periodicity of n minutes...?


avatar
21
LLIAMAH 11.11.2011 21:03
I mean, there is one parameter and it changes every year. And I want to create an auxiliary advisor that will save this parameter to a file in text format or better yet in excel. The periodicity of information in the file, I think I can write myself, most importantly the code or function that creates a file and writes there information when you access it. Can you help?
 

Не получается прочитать один из буферов индикатора PerkyAsctrend1.

Please help me to figure this out. I've done this many times with other indicators, always without any problems. This one doesn't work.

I read two buffers: one of them:

double PerkyBuf2=iCustom (NULL,0," PerkyAsctrend1 ",5,250,0,1); - it reads correctly, signal is caught, next line tries to catch:

double PerkyBuf1=iCustom (NULL,0," PerkyAsctrend1 ",5,250,1,1); and all signals of this buffer fly past my EA. I even tried to create an empty Expert Advisor with two Comment() points with results. I cannot get a signal for sell.

Can you help me understand it.

I would like to attach indicator

Files:
Reason: