forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Technical Indicators → request a indicator that Exit at certain hours or minutes after trade

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 5

Topic: request a indicator that Exit at certain hours or minutes after trade

Hi Footon

Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made?

Thank!

Re: request a indicator that Exit at certain hours or minutes after trade

SurfingWave wrote:

Hi Footon

Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made?

Thank!

No, indicators don't have access to position info, so it can't be done. You can though use N-bar Exit as a sort of workaround.

Re: request a indicator that Exit at certain hours or minutes after trade

footon wrote:
SurfingWave wrote:

Hi Footon

Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made?

Thank!

No, indicators don't have access to position info, so it can't be done. You can though use N-bar Exit as a sort of workaround.

Thanks! Will try your suggestions.

Re: request a indicator that Exit at certain hours or minutes after trade

Tried your suggestion fall short.

trade at certain time base on Server trade starts 8am to 1pm.

here my ChatGpT code:

// YourMainScriptOrIndicator.mq4
#include "TradingTimeFunctions.mqh"

// Trading hours in server time (in hours)
int tradingStartTime = 8;
int tradingEndTime = 13;

// The start function
int start()
{
    // Check if trading is allowed
    if (IsTradingAllowed(tradingStartTime, tradingEndTime))
    {
        // Trading is allowed during these hours
        Print("Trading is allowed. Current server time: ", TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));
    }
    else
    {
        // Trading is not allowed outside these hours
        Print("Trading is not allowed. Current server time: ", TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));
    }

    return 0;
}

Because, I'm lacking of coding knowledge. I wanna make sure this code works in FSB pro. I willing to pay for the service pm me lets negotiate. Pardon my grammar second language.

SurfingWave wrote:
footon wrote:
SurfingWave wrote:

Hi Footon

Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made?

Thank!

No, indicators don't have access to position info, so it can't be done. You can though use N-bar Exit as a sort of workaround.

Thanks! Will try your suggestions.

Re: request a indicator that Exit at certain hours or minutes after trade

I don't understand, do you want a custom indicator or you are trying to modify exported EAs?

Secondly, is this about defining a trading session? You said you want to close positions after certain time has passed. N-bar indi works well for that in most cases. If you are trying to limit trading time then use Entry Time indi.

SurfingWave wrote:

Tried your suggestion fall short.

trade at certain time base on Server trade starts 8am to 1pm.

here my ChatGpT code:


// YourMainScriptOrIndicator.mq4
#include "TradingTimeFunctions.mqh"

// Trading hours in server time (in hours)
int tradingStartTime = 8;
int tradingEndTime = 13;

// The start function
int start()
{
    // Check if trading is allowed
    if (IsTradingAllowed(tradingStartTime, tradingEndTime))
    {
        // Trading is allowed during these hours
        Print("Trading is allowed. Current server time: ", TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));
    }
    else
    {
        // Trading is not allowed outside these hours
        Print("Trading is not allowed. Current server time: ", TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));
    }

    return 0;
}


Because, I'm lacking of coding knowledge. I wanna make sure this code works in FSB pro. I willing to pay for the service pm me lets negotiate. Pardon my grammar second language.

SurfingWave wrote:
footon wrote:

No, indicators don't have access to position info, so it can't be done. You can though use N-bar Exit as a sort of workaround.

Thanks! Will try your suggestions.

Posts: 5

Pages 1

You must login or register to post a reply

Forex Software → Technical Indicators → request a indicator that Exit at certain hours or minutes after trade

Similar topics in this forum