Weekend evening - page 6

 
Vladimir Karputov:
Sorry, until the stock exchange gives access, all stock exchange enthusiasts go flying over Paris.

Why don't you write for MQ-Demo? Please, access to the exchange... Just with a delay.

J2T - access without delay. AMP - no delay. BCS - even real without delay (i.e. you can test on real quotes!).

 
Alexey Kozitsyn:

Why don't you write for MQ-Demo? Please, access to the exchange... Just with a delay.

If demo forex is almost identical to real, then demo on exchange is something terribly distant from real. That's why for testing and writing for the exchange, you need a real one.

 
Vladimir Karputov:

If the forex demo is an almost identical outline to the real one, then the forex demo is something eerily distant from the real one. That's why for testing and writing for the Exchange, you need a real one.

Vladimir, you do not need to tell me about the differences between the demo on the forex and the demo on the stock exchange. I've learned about these differences in my time, this thread is still on the forum. I will find it now.

As for those companies that I pointed out, the quotes are not from the DEMO CONTROL of our stock exchange! And the real exchange data. Just on demo. Also:

1. the question remains why you do not write under MQ-Demo. The real data is broadcast there;

2) I also cited BCS - there you can open a real without visiting the office. And test on real data in the tester.

Added. Back in 2016 I was proving that the demos I'm talking about are not the demo circuit of an exchange. Here's the link.

 
Vladimir Karputov:
Sorry, until the exchange gives access, all exchange fans go flying over Paris.

I would not have asked you to write a program for free, but to refuse your offer to make an EA would have been foolish. If you can't write code for the exchange, write what you can, the main thing is that it won't have those errors you wrote about.

 
Sile Si:

Hello.

Terms of Reference.

For hedge and netting accounts.

Condition for opening a position.

The height of the body of the current candle is "a_" percent higher than the average height of "b_" number of candles. Entry "c_" seconds before the signal candle closes in the direction of the candle, or in the opposite direction when "revers"=true. After opening a position in the direction of the candle (at "revers"=false), set an averaging limit order with the volume equal to the lot of the previous trade, multiplied by the "koef" coefficient, at a distance of "d" percent of the current candle's height from the trade price.

When activating a limit order, set the limit order at the same distance from the price of the last trade as the distance from the opening of the first trades. Limit the quantity of installations of the limit order "e_" times. If "reverse"=true, do not set the averaging order.

Take profit.

Limit order instead of TAP.

Set a limit order after opening the position at the distance of "tp_". In case the price moves against the position and activates the averaging order, then move the Limit order to the distance "tp_" from the average price of transactions and increase its volume in accordance with the volume of the position. If upon activation of the order "tp_" the position is not closed in its entirety, close the remaining volume on the market.

Transfer to B.O.U., trawl.

If the current price is higher than the position price plus f_" per cent of the signal candle height, set a stop order with an appropriate lot to the breakeven price taking into account the accumulated swap and commission. Adjust the order price as swap is accumulated.

If the current price is higher than the position price plus "g_" per cent of the signal candlestick height, move the stop order to a distance of "h_" from the current price, pull the stop order if the price has changed by a step = "i_" points.

Stop loss - "sl_", zero by default, do not set. If more than zero, set stop order at a distance of "sl_" points from the price of transaction, if more than one transaction is open, then from the average price of transactions. Close according to the market if the volume of stop order is not executed all.

In the external settings, specify a lot "lots_" fixed or a percentage of the deposit, and all parameters from the task "a_", "b_", etc.

I will start with small portions.

As soon as there are"Seconds before closing the signal candle" seconds left before the current candle closes, we calculate the average size of"Number of candles for calculating the average candle size" candles. If the current candle exceeds the average size by"Current candle: excess body size, percents" - we open a position with the volume"Lots" and place a pending limit order with the volume"Lots" *"Multiplication factor" from the opening price at the distance of"Pending limit level: percent of the height of the current candle" in percent of the signal candle height.

Does it seem to be correct?


 

T1LEIugo.mq5

version "1.000"


To check the current operation, set a breakpoint


This will allow you to visually evaluate the correctness of the algorithm in the strategy tester.

Files:
T1LEIugo.mq5  8 kb
 
Vladimir Karputov:

Is that right?


That is correct. Probably one would need to place a limit order T\P right away, probably even before the averaging limit order.

Addendum to point revers:

...if "reverse"=true, do not place an averaging order. Open a position or set a limit order ("lim_"=true/false). At a distance from the current price, "d" percent of the height of the current candle. Life time of the order in bars of the current period.

 
Sile Si:

That's right. Probably a limit order would have to be placed immediately, probably even before the averaging limit order.

Addendum to revers:

...if "reverse"=true, do not place an averaging order. Open a position or set a limit order ("lim_"=true/false). At the distance from the current price, "d" percent of the height of the current candle.The order lifetime in bars of the current period.

And what will happen when the pending Limit order expires and does not trigger? It will be deleted automatically and the position will be left without a protective Take Profit?

 
Vladimir write me an advisor for 30 bucks
 
Лауреат:
Vladimir, write me an EA for 30 bucks.

What kind of advisor is it? Working principles? Forex or Exchange? Netting or hedging?

Reason: