Simple Coding Help - No Promise.

amitrandive

Well-Known Member
Hi All,

I need AFL to plot 1 min, 5 min and 15 min in the same chart (not diff pane). And probably option to switch the TF in param.. like instead of 1, 5, 15.. I want to plot 5, 15, 30.. etc.

Thanks for the help.
Manish

Here is another one


Code:
SetChartBkGradientFill(colorWhite,colorLightGrey,colorWhite);
Period= ParamList("Base","Monthly|Weekly|Daily|Hourly|15Minute|5Minute|1Minute",0);
 
if(Period=="Monthly"){
 TimeFrameSet(inMonthly);
PlotOHLC(Open, High, Low, Close, "Monthly Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
if(Period=="Weekly"){
TimeFrameSet(inWeekly);
PlotOHLC(Open, High, Low, Close, "weekly Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
if(Period=="Daily"){
TimeFrameSet(inDaily);
PlotOHLC(Open, High, Low, Close, "Daily Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
if(Period=="Hourly"){
 TimeFrameSet(inHourly);
PlotOHLC(Open, High, Low, Close, "Hourly Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
if(Period=="15Minute"){
 TimeFrameSet(in15Minute);
PlotOHLC(Open, High, Low, Close, "15Minute Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
if(Period=="5Minute"){
 TimeFrameSet(in5Minute);
PlotOHLC(Open, High, Low, Close, "5Minute Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
if(Period=="1Minute"){
 TimeFrameSet(in1Minute);
PlotOHLC(Open, High, Low, Close, "1Minute Price Chart", colorBlack, style = styleCandle | styleOwnScale);
Plot(V,"Volume",colorWhite, styleHistogram);
}
 

mcxinvest

Well-Known Member
hello,
Below i have put down my strategy where i want the buy/short to take place once the close is greater than the high of the buying bar and close is lesser then the low of the short bar..
Buy=Cross(EMA(C,10),EMA(C,20)) and close > EMA(C,50);
Sell = Close < EMA(C<50) OR, EMA(C,10)< EMA(C,20);
Short=Cross(EMA(C,50),EMA(C,20)) and close < EMA(C,50);
Cover =Close > EMA(C,50) OR, EMA(C,10) > EMA(C,20);
for instance:
Nifty is trading above 50 EMA and there is a crossover of 10 & 20 EMA. The bar on which the buy call is generated has the high 6850. so any nxt bar after that which gives me the close above 6850 will be my actual buy price or buying bar. Revers goes with the Short call.
Also if the option is given on how to restrict the number of bars after the crossover and the close above the high. i.e if the high is broke within next 3-4 bars than buying should be made otherwise call is nullified.
 

amitrandive

Well-Known Member
hello

this afl shows syntax errors . please see it and make it working


SetChartOptions(0,chartShowDates|chartLogarithmic|chartWrapTitle);
#pragma nocache
// Commentry output ....
EnableTextOutput(False);
System= ParamList("System Selection","NiftyPro4.2|Option_Trading|NiftyPro3.6|NiftyPro3.5",0);
SL1_show = ParamToggle("10 Min SL", "Off|On");
AudioAlert = ParamToggle("Audio Alert", "On|Off");
Print_SR = ParamToggle("Print Minor Levels", "Off|On");
Print_Band = ParamToggle("Print Band", "Off|On");
Print_Fib = ParamToggle("Intraday Fibonacci", "Off|On");

}
.
..
.


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
_SECTION_END();
Missing Dll files for this page of AFL's
 

amitrandive

Well-Known Member
hello,
Below i have put down my strategy where i want the buy/short to take place once the close is greater than the high of the buying bar and close is lesser then the low of the short bar..
Buy=Cross(EMA(C,10),EMA(C,20)) and close > EMA(C,50);
Sell = Close < EMA(C<50) OR, EMA(C,10)< EMA(C,20);
Short=Cross(EMA(C,50),EMA(C,20)) and close < EMA(C,50);
Cover =Close > EMA(C,50) OR, EMA(C,10) > EMA(C,20);
for instance:
Nifty is trading above 50 EMA and there is a crossover of 10 & 20 EMA. The bar on which the buy call is generated has the high 6850. so any nxt bar after that which gives me the close above 6850 will be my actual buy price or buying bar. Revers goes with the Short call.
Also if the option is given on how to restrict the number of bars after the crossover and the close above the high. i.e if the high is broke within next 3-4 bars than buying should be made otherwise call is nullified.
check post #1631
 

Similar threads