My question is:
Who can I add the condition " if a position is open in this pair, turn off alerts", in a indicator?
For example if I had this code
- Code: Select all
void manageAlerts()
{
if (alertsOn)
{
int whichBar = 1; if (alertsOnCurrent) whichBar = 0;
if (trend[whichBar] != trend[whichBar+1])
{
if (trend[whichBar]== 1) doAlert(whichBar,"up");
if (trend[whichBar]==-1) doAlert(whichBar,"down");
}
}
}
I was thinking in the lines of :
void manageAlerts()
{
if (alertsOn) && (command that tells that there is not a position open in that symbol ) = true
or
void manageAlerts()
{
if (alertsOn) && (command that tells that there is position open in that symbol ) = false
I don't know code , I know little of programming, but enough to understand the logic of the code.
Thank you for your help in advance.