Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created June 25, 2016 11:41
Show Gist options
  • Select an option

  • Save marketcalls/2d0f5914bafe4fb8235368a2a6320412 to your computer and use it in GitHub Desktop.

Select an option

Save marketcalls/2d0f5914bafe4fb8235368a2a6320412 to your computer and use it in GitHub Desktop.
Predict Cycle
//Coded by Rajandran R
//Website : www.marketcalls.in
_SECTION_BEGIN("Predict Cycle");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}} - Cycle analysis indicator from www.marketcalls.in", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", colorDefault, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
//Cycle Component
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Predict = PredictCycle(C,Periods);
Buy = Predict>Ref(Predict,-1);
Sell = Predict<Ref(Predict,-1);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot(Predict,"Predict",coloryellow,styleLine | styleThick);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
_SECTION_END();
@sridharla3

Copy link
Copy Markdown

I just applied this formulae in amibroker.. but syntax error is

PredictCycle:
//Cycle Component
P=ParamFiedl("Price field",1);
Periods=Param(Periods,15,2,300,1,10);
Predict=PredictCycle(C,Periods)
............^
File:'Formulas\Drag-drop\PredictCycle3.afl,Ln:15,Col:33
Error 30,
Syntax Error, identifier 'Predcitcycle' is undefined.

Use 'Edit Formula' to correct error"

any help?

@mahsud1937

Copy link
Copy Markdown

Yes, i am having the same error. I have also checked and found that PredictCycle.dll is NOT somehow loading in AB - that could be reason!

@tgbssk

tgbssk commented Nov 6, 2023

Copy link
Copy Markdown

it will not work without plugin DLL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment