You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You need to redo the code: request data not from one bar, but from two. And check the condition not on one bar - but on two.
It was (#23 ):
Will be:
Thanks. Ive tried editing it but ive almost scattered the entire code. How can i edit this please to add the buy on next bar instead of immediately i.e either at close price of present candle or at new candle open price. Or even to tell it to check the last bar if conditions were met then trigger buy (dont think it would work well but what do i know)
Thanks. Ive tried editing it but ive almost scattered the entire code. How can i edit this please to add the buy on next bar instead of immediately i.e either at close price of present candle or at new candle open price. Or even to tell it to check the last bar if conditions were met then trigger buy (dont think it would work well but what do i know)
Thanks. Ive tried editing it but ive almost scattered the entire code. How can i edit this please to add the buy on next bar instead of immediately i.e either at close price of present candle or at new candle open price. Or even to tell it to check the last bar if conditions were met then trigger buy (dont think it would work well but what do i know)
iRSI simple advisor, version1.006
This is how the adviser works now: we check the signal ONLY AT THE MOMENT OF THE BIRTH OF A NEW BAR. The new bar has index # 0, we call the new bar "Current Bar". Example of a BUY signal: if the two previous bars (bar # 1 and bar # 2) are below the '30' line, this is a BUY signal:
Pic. 1. iRSI simple advisor, version1.006
The code:
iRSI simple advisor, version1.006
This is how the adviser works now: we check the signal ONLY AT THE MOMENT OF THE BIRTH OF A NEW BAR. The new bar has index # 0, we call the new bar "Current Bar". Example of a BUY signal: if the two previous bars (bar # 1 and bar # 2) are below the '30' line, this is a BUY signal:
Pic. 1. iRSI simple advisor, version1.006
The code:
Couldn't get it to work... This is the file for the EA, please help me look at it to understand me.
Couldn't get it to work... This is the file for the EA, please help me look at it to understand me.
iRSI simple advisor, version1.007
In this version: the signal is checked at each tick: as soon as the signal is received, we immediately stop the search for the signal and wait for a new bar. At the time of the birth of a new bar (if there is a saved signal), open a position.
Example CopyRates
The first form of calling CopyRates is used:
Please note that ArraySetAsSeries is applied to the ' rates ' array - in this case, rates [0] corresponds to the rightmost bar on the chart.
The full code:
Result:
Example: delete all pending orders of a certain type.
An example in the form of a script: in the input parameter ' Delete all: ' the type of a pending order is set and then the delete function 'DeleteOrders ' is called
this is the simplest example: there is no filter by symbol, there is no filter by Magic number, there is no verification of the minimum distance (level of freezing), and there is no cycle to guarantee deletion.
Example: Calculate Positions and Pending Orders
Code: Calculate Positions and Pending Orders.mq5
Trade classes CPositionInfo and COrderInfo are used (Do not confuse current pending orders with positions, which are also displayed on the "Trade" tab of the "Toolbox" of the client terminal.)
The code:
A simple example. Displaying iADX indicator values on a chart
This is a simple example: how to get the values of the iADX indicator. For control, the obtained values are displayed on the screen.
Code:
Result: