Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
hello guys know am a newbie
and i have only been trading for a month now
i use this indicator to look for spikes within spikes
just wanted to ask if anyone could help me turn this indicator into an multi-time frame indicator and also if possible add alert to it
big thanks in advance
It's quite simple, just check the example below, which is using 3 timeframes:
protected override void Initialize(){
SetProfitTarget("", CalculationMode.Ticks, stopWin);
SetStopLoss("", CalculationMode.Ticks, stopLoss, false);
// Add a 5 minute Bars object to the strategy
Add(PeriodType.Minute, 5); //BarsArray[1]
// Add a 15 minute Bars object to the strategy
Add(PeriodType.Minute, 15); //BarsArray[2]
// Note: Bars are added to the BarsArray and can be accessed via an index value
// E.G. BarsArray[1] ---> Accesses the 5 minute Bars object added above
Add(StochasticMomentumIndex(3,5));
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
// Checks if the 5 period SMA is above the 50 period SMA on both the 5 and 15 minute time frames
if (StochasticMomentumIndex(BarsArray[2],3,5)[0] > maxL5 &&
StochasticMomentumIndex(BarsArray[1],3,5)[0] > maxL15 &&
StochasticMomentumIndex(3,5)[0] > MaxL1)
{
EnterShort(1, "STO Short");
}
if (StochasticMomentumIndex(BarsArray[2],3,5)[0] < minL5 &&
StochasticMomentumIndex(BarsArray[1],3,5)[0] < minL15 &&
StochasticMomentumIndex(3,5)[0] < minL1)
{
EnterLong(1, "STO Long");
}
}
Hey i have only been trading for a month now
i use this indicator to look for spikes within spikes
just wanted to ask if you guys could help me turn this indicator into an multi-time frame indicator and also if possible add alert to it
big thanks in advance
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
mwamba123
Hey i have only been trading for a month now
i use this indicator to look for spikes within spikes
just wanted to ask if you guys could help me turn this indicator into an multi-time frame indicator and also if possible add alert to it
big thanks in advance
Are you trying to turn this into an Indicator or a Strategy? The reason I ask is because you are have SetProfitTarget which is for trading using a Strategy
Are you trying to turn this into an Indicator or a Strategy? The reason I ask is because you are have SetProfitTarget which is for trading using a Strategy
oh no sir no strategy just an indicator
i use it mostly for options
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
mwamba123
oh no sir no strategy just an indicator
i use it mostly for options
ok so EnterLong(1, ....); and EnterShort(1, .....); and SetStops and SetProfitTarget, etc.. are all things you use in a Strategy.
It looks like you are correct how you added the multiple time frames
you can also use BarsInProgress
lets say you have it like
protected override void Initialize()
{
Add(PeriodType.Minute, 5); // index of 1
Add(PeriodType.Minute, 15); // index of 2
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
// anything in here is base chart
if (Close[0] > Open[0]) // The Close and Open refers to the base chart
// do something
// if you want to refer to another chart inside of BIP == 0 then do it this way
if (Close[1][0] > Open[1][0])
// do something
}
if (BarsInProgress == 1)
{
// same as above Close[0] refers to BIP == 1 and Close[0][0] refers to base chart
// and Close[2][0] refers to BIP == 2
}
}
I believe how you have it with BarsArray is correct. You use BarsArray with premade indicators
let me know if anymore questions
ok so EnterLong(1, ....); and EnterShort(1, .....); and SetStops and SetProfitTarget, etc.. are all things you use in a Strategy.
It looks like you are correct how you added the multiple time frames
you can also use BarsInProgress
lets say you have it like
protected override void Initialize()
{
Add(PeriodType.Minute, 5); // index of 1
Add(PeriodType.Minute, 15); // index of 2
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
// anything in here is base chart
if (Close[0] > Open[0]) // The Close and Open refers to the base chart
// do something
// if you want to refer to another chart inside of BIP == 0 then do it this way
if (Close[1][0] > Open[1][0])
// do something
}
if (BarsInProgress == 1)
{
// same as above Close[0] refers to BIP == 1 and Close[0][0] refers to base chart
// and Close[2][0] refers to BIP == 2
}
}
I believe how you have it with BarsArray is correct. You use BarsArray with premade indicators
let me know if anymore questions
hey thank you very much for all of this
i barely understand what you have just explained to me
i have little to no knowledge of coding...
i just started trading and am still practicing on demo accounts.
i just have the basic knowledge of everything
and i just started reading about coding