Home › Forums › Trading System Mentor Course Community › AmiBroker Coding and AFL › Norgate adjusted close function
- This topic is empty.
-
AuthorPosts
-
February 19, 2017 at 12:58 am #101607Stephen JamesMember
I noticed some are using the backward compatibility code as it comes up when typing Norgate in the editor. From Norgate below:-
NorgateBackwardsCompatibilityOriginalCloseTimeSeries is essentially the same as NorgateOriginalCloseTimeSeries. Likewise, NorgateBackwardsCompatibilityOriginalVolumeTimeSeries is essentially the same as NorgateOriginalVolumeTimeSeries.
We will probably rename the NorgateBackwardsCompatibility indicators this week so that they don’t appear when you start typing “Norg” in the AFL editor.
In any case, you should not use the BackwardsCompatibility ones – you should be using NorgateOriginalCloseTimeSeries() and NorgateOriginalVolumeTimeSeries() etc.February 19, 2017 at 1:08 am #106282LEONARDZIRParticipantCraig,
Where do you put the NorgateOriginalVolumeSeries? It is not mentioned in the LMS additions page. I presume you substitute it for V in the volume turnover code.
LenFebruary 19, 2017 at 10:23 pm #106283Stephen JamesMemberI’ll most likely add some content around the volume in the next week or so Len after I’ve had a closer look at all the changes.
February 19, 2017 at 11:12 pm #106288LEONARDZIRParticipantThanks Craig.
LenFebruary 21, 2017 at 12:39 am #106289Stephen JamesMemberHere’s some price and volume filters I knocked up until I get to changing course content. The unadjusted series are arrays so it seems no problem to apply averages. If anyone finds any issues, please let me know.
Code:#include_once “FormulasNorgate DataNorgate Data Functions.afl”_SECTION_BEGIN (“Optional Price & Volume Filters”);
//=================================================================================
//Optional Price & Volume Filters
//=================================================================================
CloseToggle = ParamToggle(“Close Price”,”Adjusted|Unadjusted”,0);
CloseArray = IIf(CloseToggle,NorgateOriginalCloseTimeSeries(),Close);VolumeToggle = ParamToggle(“Volume”,”Adjusted|Unadjusted”,0);
VolumeArray = IIf(VolumeToggle,NorgateOriginalVolumeTimeSeries(),Volume);
//———————————————————————————
PriceTog = ParamToggle(“Price Filter”,”Off|On”,0);
MinSP = Param(“Minimum Share Price – $”,5,0.00,1000,0.01);
MaxSP = Param(“Maximum Share Price – $”,100,0.00,2000,0.01);
MinMaxSP = CloseArray >= MinSP AND CloseArray <= MaxSP; PriceFilt = IIf(PriceTog,MinMaxSP,1); //--------------------------------------------------------------------------------- TOTog = ParamToggle("Turnover Filter","Off|On",0); Turnover = CloseArray*VolumeArray; MinTO = Param("Minimum Turnover - $",300000,0,10000000,1000); TOMA = Param("Turnover MA",5,1,200,1); AveTO = MA(Turnover,TOMA); TOFilter = AveTO > MinTO AND Turnover > MinTO;
TOFilt = IIf(TOTog,TOFilter,1);
//———————————————————————————
VolTog = ParamToggle(“Volume Filter”,”Off|On”,0);
MinVol = Param(“Minimum Volume”,300000,0,10000000,1000);
VolFilter = VolumeArray > MinVol;
VolFilt = IIf(VolTog,VolFilter,1);
//———————————————————————————
AveVolTog = ParamToggle(“Average Volume Filter”,”Off|On”,0);
MinAveVol = Param(“Minimum Average Volume”,500000,0,10000000,1000);
AVPer = Param(“Volume EMA”,50,1,200,1);
AveVol = EMA(VolumeArray,AVPer) > MinAveVol;
AveVolFilt = IIf(AveVolTog,AveVol,1);
//———————————————————————————
OptFilt = PriceFilt AND TOFilt AND VolFilt AND AveVolFilt;//=================================================================================
_SECTION_END(); -
AuthorPosts
- You must be logged in to reply to this topic.