hyderabad
Posts: 13 since Oct 2012
Thanks Given: 1
Thanks Received: 0
|
Hi,
I am using MACD for generating buy and sell calls. now i want to filter my signals with suppertrend indicator.
suppertrend indicator for UPTREND & DOWN TREND.
EX: i don't want to plot GREEN ARROW(BUY) in DOWN TREND
i don't want to plot RED ARROW (SELL) in UP TREND
this is my MACD code:
{
if(TSSuperTrend(7, TradingStudies.NinjaScript.Utility.MovingAverageType.HMA, 1.618, 7, TradingStudies.NinjaScript.Utility.SuperTrendMode.Adaptive).Trend[0]==true)
if(CrossAbove(dotSeries, BB_UpperBand,1)&&up)
{
{
Say(" There is a Buy Call in" +Instrument.FullName+"" );
over=true; // only say it once per bar
}
{
DrawArrowUp("up"+CurrentBar,false,0,Low[0]+2*TickSize,Color.Green);
}
up=true;
down=true;
}
}
{
if(TSSuperTrend(7, TradingStudies.NinjaScript.Utility.MovingAverageType.HMA, 1.618, 7, TradingStudies.NinjaScript.Utility.SuperTrendMode.Adaptive).Trend[0]==false)
if(CrossBelow(dotSeries, BB_LowerBand,1)&&down)
{
{
Say(" There is a Sell Call in " +Instrument.FullName+ "");
over=true; // only say it once per bar
}
{
DrawArrowDown("down"+CurrentBar,false,0,High[0]+2*TickSize,Color.Red);
}
up=true;
down=true;
}
}
I have problume with "&&up""&&down" Functions. i can't see my Arrows in correct place. because of "&&up".
EX:GREEN ARROWS waiting for RED ARROWS. please give me your valuable suggestions.
Thank You,
ParuchruiPhani.
|