Best Nifty Strategy-Must Read

Need AFl For
Condition is Like
1) IF Price candle Close above EMA Then Buy Signal
IF price candle Close Below EMA Then Sell Signal
2) At End Of the Day Clear All Intraday position Like
If last call in buy Then Next call At End OF the day(3.15) Is Sell Signal
If last call in Sell then Next call at End Of the day(3.15) Is buy Signal
3) From Next day continue With 1)st Condition With 1st candle I mean If Yesterday Price Trend belove EMA And 2) Condition clear position With buy Signal at 3.15 Then If next Day Market Also Open Belove EMA So First candle Give Sell Signal And Then continue As 1) ,2),3)

If u can Complete this With My AFL Ya your Then Please Post Here Full AFL

Still Waiting For your reply MSA5678
 

msa5678

Well-Known Member
Need AFl For
Condition is Like
1) IF Price candle Close above EMA Then Buy Signal
IF price candle Close Below EMA Then Sell Signal
2) At End Of the Day Clear All Intraday position Like
If last call in buy Then Next call At End OF the day(3.15) Is Sell Signal
If last call in Sell then Next call at End Of the day(3.15) Is buy Signal
3) From Next day continue With 1)st Condition With 1st candle I mean If Yesterday Price Trend belove EMA And 2) Condition clear position With buy Signal at 3.15 Then If next Day Market Also Open Belove EMA So First candle Give Sell Signal And Then continue As 1) ,2),3)

If u can Complete this With My AFL Ya your Then Please Post Here Full AFL

Still Waiting For your reply MSA5678
Which EMA you are using in your strategy.
 
Which EMA you are using in your strategy.
Its Depent on time Perameters I use Mose Of 21 day EMA But I Need This Code For Any AFL Where i can use it with Some modification in buy Sell perameter just Time Condition is same

Right now Need For EMA OF 21 Day
buy Above EMA
Sell Below EMA
Exit At End OF marekt 3.15 ya 3.30
Re Entry At opening at next day On First candel If Its Below the EMA Then
in Sell And IF above Then buy
 

msa5678

Well-Known Member
Its Depent on time Perameters I use Mose Of 21 day EMA But I Need This Code For Any AFL Where i can use it with Some modification in buy Sell perameter just Time Condition is same

Right now Need For EMA OF 21 Day
buy Above EMA
Sell Below EMA
Exit At End OF marekt 3.15 ya 3.30
Re Entry At opening at next day On First candel If Its Below the EMA Then
in Sell And IF above Then buy
Took the original AFL posted by you, added the lines posted by "Rajvir" and below is the end result.
Code:
_SECTION_BEGIN("Price ");

BarsToday = 1 + BarsSince( Day() != Ref(Day(), -1));

StartBar = ValueWhen(TimeNum() == 091500, BarIndex());


Plot(C, "", IIf(C > O, colorBrightGreen, colorRed), ParamStyle("Price Style", styleCandle, maskPrice));

Title = FullName()+" - "+Name()+"\nO:"+O+", H:"+H+", L:"+L+", C:"+C;
_SECTION_END();

_SECTION_BEGIN("EMA");

P = ParamField("Price field",-1);
Periods = Param("Periods", 20, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 

Buy=(Cross(C, EMA( P, Periods) AND TimeNum()<150000) OR timenum() > 151500 ;
Sell = (Cross(EMA( P, Periods),C) AND TimeNum()<150000) OR timenum() > 151500 ;

Buy= ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy); 

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorCu stom11); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo rCustom12);

_SECTION_END();
 
Took the original AFL posted by you, added the lines posted by "Rajvir" and below is the end result.
Code:
_SECTION_BEGIN("Price ");

BarsToday = 1 + BarsSince( Day() != Ref(Day(), -1));

StartBar = ValueWhen(TimeNum() == 091500, BarIndex());


Plot(C, "", IIf(C > O, colorBrightGreen, colorRed), ParamStyle("Price Style", styleCandle, maskPrice));

Title = FullName()+" - "+Name()+"\nO:"+O+", H:"+H+", L:"+L+", C:"+C;
_SECTION_END();

_SECTION_BEGIN("EMA");

P = ParamField("Price field",-1);
Periods = Param("Periods", 20, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 

Buy=(Cross(C, EMA( P, Periods) AND TimeNum()<150000) OR timenum() > 151500 ;
Sell = (Cross(EMA( P, Periods),C) AND TimeNum()<150000) OR timenum() > 151500 ;

Buy= ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy); 

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorCu stom11); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo rCustom12);

_SECTION_END();
Ya dear I try it Before When Rajiv Help Me But its Not Working As i want
I want For Next Day Fresh position At First candle Please U Add this AFL in Your Ami Soft And Check In this Afl I am not Getting Any Signal In Day Time
My Condition IS

1) (9.15 To 3.15) If Price Go Above Then BUY Signal
IF Price Go Bellow Then SELL Signal

2) At @ 3.15 If Last Signal Before 3.15 IS BUY then @ 3.15 i need Sell Signal For Clear position And IF Last Signal Before 3.15 is Sell Then I need buy Signal At @ 3.15

Above 1 or 2 Condition i Fulfill From Rajiv and Your Both code but 3 not Done 3 Condition I need also


3) Is At Next Working DAY If market Open Belove EMA Then in 1 Minuit ya any parameter which i use i need Sell Signal With Opening and Open Above EMA then I need Buy Signal I means I need Sell ya buy Signal From 1st candel of day Forget about last day trend what is close in new day i need Fresh Signal
 

msa5678

Well-Known Member
Ya dear I try it Before When Rajiv Help Me But its Not Working As i want
I want For Next Day Fresh position At First candle Please U Add this AFL in Your Ami Soft And Check In this Afl I am not Getting Any Signal In Day Time
My Condition IS

1) (9.15 To 3.15) If Price Go Above Then BUY Signal
IF Price Go Bellow Then SELL Signal

2) At @ 3.15 If Last Signal Before 3.15 IS BUY then @ 3.15 i need Sell Signal For Clear position And IF Last Signal Before 3.15 is Sell Then I need buy Signal At @ 3.15

Above 1 or 2 Condition i Fulfill From Rajiv and Your Both code but 3 not Done 3 Condition I need also


3) Is At Next Working DAY If market Open Belove EMA Then in 1 Minuit ya any parameter which i use i need Sell Signal With Opening and Open Above EMA then I need Buy Signal I means I need Sell ya buy Signal From 1st candel of day Forget about last day trend what is close in new day i need Fresh Signal
Sorry Dear ,

Here is the updated version:
Code:
_SECTION_BEGIN("Price ");

BarsToday = 1 + BarsSince( Day() != Ref(Day(), -1));

StartBar = ValueWhen(TimeNum() == 091500, BarIndex());


Plot(C, "", IIf(C > O, colorBrightGreen, colorRed), ParamStyle("Price Style", styleCandle, maskPrice));

Title = FullName()+" - "+Name()+"\nO:"+O+", H:"+H+", L:"+L+", C:"+C;
_SECTION_END();

_SECTION_BEGIN("EMA");

P = ParamField("Price field",-1);
Periods = Param("Periods", 20, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 

Buy=(Cross(C, EMA( P, Periods) AND TimeNum()<150000) OR timenum() > 151500 OR C>EMA( P, Periods) ;
Sell = (Cross(EMA( P, Periods),C) AND TimeNum()<150000) OR timenum() > 151500 OR C<EMA( P, Periods) ;

Buy= ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy); 

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorCu stom11); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo rCustom12);

_SECTION_END();
Please note that I have added an OR condition at the end of Buy and Sell Conditions.


I hope members don't get annoyed with the distractions to the thread.
 

Similar threads