The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC" using only Open, High, Low and Close prices of minute bars; detailed modeling in "Every tick" mode, as well as the most accurate "Every tick based on real ticks" mode applying actual historical data. Comparing the results allows us to assess...
A check must be added to this skeleton. A lot of checks.
But the main idea will be this:
* if there are no pending orders in the market (Buy Stop for example) - the adviser issues an order "to place a pending Buy Stop order)
* when a pending order is triggered, a position will appear and the adviser will again issue an order "to place a pending Buy Stop order)
Added: it is possible to complicate the logic - the trade order "place a pending Buy stop order" is issued only if there are NO pending orders in the
market and if there are NO positions in the market.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Example:
Result:
Ok!
When I tried this code I received a lot of errors.
Ok!
When I tried this code I received a lot of errors.
#21
Hi Vladmir
Tks again for your help!
I used your code but receive the same result.
I had executed the backtest to 10 months and itthe made a lot of orders.
I would like to do the sequecen bellow.
1 - I buy one stock / Price - $20 / StopLoss - $20 / Takeprofit - $21
This order will be executed and if I tried to see if have one orderopen I will receive return > 0 correct?
2 - If the order rise to $21 ou $22 the MQL5 will send a order to sell or buy correct? this is a orderopen?
3 - After it if I want to send a new order to buy one stock / Price - $22 / StopLoss - $24 / Takeprofit - $22
I cannot submit a new order if I have a StopLoss or Takeprofit waiting to be executed.
Hi Vladmir
Tks again for your help!
I used your code but receive the same result.
I had executed the backtest to 10 months and itthe made a lot of orders.
I would like to do the sequecen bellow.
1 - I buy one stock / Price - $20 / StopLoss - $20 / Takeprofit - $21
This order will be executed and if I tried to see if have one orderopen I will receive return > 0 correct?
2 - If the order rise to $21 ou $22 the MQL5 will send a order to sell or buy correct? this is a orderopen?
3 - After it if I want to send a new order to buy one stock / Price - $22 / StopLoss - $24 / Takeprofit - $22
I cannot submit a new order if I have a StopLoss or Takeprofit waiting to be executed.
Use the code from #21 .
This is the basis of the skeleton.
A check must be added to this skeleton. A lot of checks.
But the main idea will be this:
Added: it is possible to complicate the logic - the trade order "place a pending Buy stop order" is issued only if there are NO pending orders in the market and if there are NO positions in the market.