I need help make a script for EA.
I need to find the highest position and the lowest position
among a groups of position. In this groups I have Buy Position and Buystop Position!
Any body can help me?
Thank you,
Xdargon
You can loop on all orders using OrderSelect(), check what type of order using OrderType() and find the highest/lowest using OrderOpenPrice().
You can loop on all orders using OrderSelect(), check what type of order using OrderType() and find the highest/lowest using OrderOpenPrice().
if you wanna get the highest or lowest in the specific time such as (one minute, 5 minutes, 30 minutes, one hour, one day,...) you can use the function :
double iHigh( | string symbol, int timeframe, int shift) |
For the current chart, the information about high prices is in the predefined array named High[].
symbol | - | Symbol on that data need to calculate indicator. NULL means current symbol. |
timeframe | - | Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe. |
shift | - | Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago). |
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
|
if you wanna get the highest or lowest in the specific time...
He is looking for 'the highest position and the lowest position', not high or low of a bar...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need help make a script for EA.
I need to find the highest position and the lowest position
among a groups of position. In this groups I have Buy Position and Buystop Position!
Any body can help me?
Thank you,
Xdargon