I trade only between certain hours (7am to 5pm). As such, I generally connect the data feed in NT8 in the morning, and then disconnect again at night.
If I trade on the hourly chart, and my strategy requires 60 hours to pass before a trade alert is generated, does this mean an Alert will never ever be generated?
I/e Do I need to leave myself connected to the data feed 24/7?
Code below:
// Look for a trigger for the strong trade
if (Position.MarketPosition == MarketPosition.Flat
&& Notrade
&& SMA(movav)[0]<SMA(movavshort)[0]
)
{ Triggerbar=CurrentBar;
Notrade=false;
GoLong=true;
}
// Switch off the potential trade if the SMA short breaks below the longer term SMA
if (Position.MarketPosition == MarketPosition.Flat
&& GoLong
&& SMA(movav)[0]>SMA(movavshort)[0]
)
{ Triggerbar=0;
Notrade=true;
GoLong=false;
}
// Switch off the potential trade if the close breaks above the longer term SMA
if (Position.MarketPosition == MarketPosition.Flat
&& GoLong
&& Close[0]<SMA(movav)[0]
)
{ Triggerbar=0;
Notrade=true;
GoLong=false;
}
if (Position.MarketPosition == MarketPosition.Flat
&& ToTime(Time[0])>70000 && ToTime(Time[0])<170000
&& SMA(movav)[0]<SMA(movavshort)[0]
&& Low[0]<SMA(movavshort)[0]
&& GoLong
&& CurrentBar-Triggerbar>60
{Enter trade;}
Comment