Home › Forums › Trading System Mentor Course Community › AmiBroker Coding and AFL › Guppy MMA Coding
- This topic is empty.
-
AuthorPosts
-
April 3, 2016 at 11:13 am #103490SaidBitarMember
Difficult to answer without seeing the code but maybe you added them twice i mean you defined them in two places
April 3, 2016 at 11:31 am #103491JulianCohenParticipantThanks Said,
Here’s the code
_SECTION_BEGIN(“Guppy MMA”);
//======================================
//Parameters
//======================================F1=EMA(Close,3);
F2=EMA(Close,5);
F3=EMA(Close,;
F4=EMA(Close,10);
F5=EMA(Close,12);
F6=EMA(Close,15);S1=EMA(Close,30);
S2=EMA(Close,35);
S3=EMA(Close,40);
S4=EMA(Close,45);
S5=EMA(Close,50);
S6=EMA(Close,60);Range=Param(“Range Fast EMA 1”,3,1,29,1);
Range=Param(“Range Fast EMA 2”,5,1,29,1);
Range=Param(“Range Fast EMA 3”,8,1,29,1);
Range=Param(“Range Fast EMA 4”,10,1,29,1);
Range=Param(“Range Fast EMA 5”,12,1,29,1);
Range=Param(“Range Fast EMA 6”,15,1,29,1);Range=Param(“Range Slow EMA 1”,30,29,100,1);
Range=Param(“Range Slow EMA 2”,35,29,100,1);
Range=Param(“Range Slow EMA 3”,40,29,100,1);
Range=Param(“Range Slow EMA 4”,45,29,100,1);
Range=Param(“Range Slow EMA 5”,50,29,100,1);
Range=Param(“Range Slow EMA 6”,60,29,100,1);_SECTION_END();
_SECTION_BEGIN(“Plotting Parameters”);
//======================================
//Colours and Style
//======================================Fast1Colour=ParamColor(“Fast EMA Colour”,colorBlue);
Fast1Style=ParamStyle(“Fast EMA Line Style”,styleLine|StyleThick);Slow1Colour=ParamColor(“Slow EMA Colour”,colorOrange);
Slow1Style=ParamStyle(“Slow EMA Line Style”,styleLine|styleThick|styleDashed);//======================================
//Plotting
//======================================
Plot(F1,”Fast EMA 1″,Fast1Colour,Fast1Style);
Plot(F2,”Fast EMA 2″,Fast1Colour,Fast1Style);
Plot(F3,”Fast EMA 3″,Fast1Colour,Fast1Style);
Plot(F4,”Fast EMA 4″,Fast1Colour,Fast1Style);
Plot(F5,”Fast EMA 5″,Fast1Colour,Fast1Style);
Plot(F6,”Fast EMA 6″,Fast1Colour,Fast1Style);Plot(S1,”Slow EMA 1″,Slow1Colour,Slow1Style);
Plot(S2,”Slow EMA 2″,Slow1Colour,Slow1Style);
Plot(S3,”Slow EMA 3″,Slow1Colour,Slow1Style);
Plot(S4,”Slow EMA 4″,Slow1Colour,Slow1Style);
Plot(S5,”Slow EMA 5″,Slow1Colour,Slow1Style);
Plot(S6,”Slow EMA 6″,Slow1Colour,Slow1Style);_SECTION_END();
April 3, 2016 at 11:41 am #103492SaidBitarMemberCode:_SECTION_BEGIN(“Guppy MMA”);//======================================
//Parameters
//======================================RangeF1=Param(“Range Fast EMA 1”,3,1,29,1);
RangeF2=Param(“Range Fast EMA 2”,5,1,29,1);
RangeF3=Param(“Range Fast EMA 3”,8,1,29,1);
RangeF4=Param(“Range Fast EMA 4”,10,1,29,1);
RangeF5=Param(“Range Fast EMA 5”,12,1,29,1);
RangeF6=Param(“Range Fast EMA 6”,15,1,29,1);F1=EMA(Close,RangeF1);
F2=EMA(Close,RangeF2);
F3=EMA(Close,RangeF3);
F4=EMA(Close,RangeF4);
F5=EMA(Close,RangeF5);
F6=EMA(Close,RangeF6);RangeS1=Param(“Range Slow EMA 1”,30,29,100,1);
RangeS2=Param(“Range Slow EMA 2”,35,29,100,1);
RangeS3=Param(“Range Slow EMA 3”,40,29,100,1);
RangeS4=Param(“Range Slow EMA 4”,45,29,100,1);
RangeS5=Param(“Range Slow EMA 5”,50,29,100,1);
RangeS6=Param(“Range Slow EMA 6”,60,29,100,1);S1=EMA(Close,RangeS1);
S2=EMA(Close,RangeS2);
S3=EMA(Close,RangeS3);
S4=EMA(Close,RangeS4);
S5=EMA(Close,RangeS5);
S6=EMA(Close,RangeS6);_SECTION_END();
_SECTION_BEGIN(“Plotting Parameters”);
//======================================
//Colours and Style
//======================================Fast1Colour=ParamColor(“Fast EMA Colour”,colorBlue);
Fast1Style=ParamStyle(“Fast EMA Line Style”,styleLine|StyleThick);Slow1Colour=ParamColor(“Slow EMA Colour”,colorOrange);
Slow1Style=ParamStyle(“Slow EMA Line Style”,styleLine|styleThick|styleDashed);//======================================
//Plotting
//======================================
Plot(F1,”nFast EMA 1″,Fast1Colour,Fast1Style);
Plot(F2,”Fast EMA 2″,Fast1Colour,Fast1Style);
Plot(F3,”Fast EMA 3″,Fast1Colour,Fast1Style);
Plot(F4,”Fast EMA 4″,Fast1Colour,Fast1Style);
Plot(F5,”Fast EMA 5″,Fast1Colour,Fast1Style);
Plot(F6,”Fast EMA 6″,Fast1Colour,Fast1Style);Plot(S1,”nSlow EMA 1″,Slow1Colour,Slow1Style);
Plot(S2,”Slow EMA 2″,Slow1Colour,Slow1Style);
Plot(S3,”Slow EMA 3″,Slow1Colour,Slow1Style);
Plot(S4,”Slow EMA 4″,Slow1Colour,Slow1Style);
Plot(S5,”Slow EMA 5″,Slow1Colour,Slow1Style);
Plot(S6,”Slow EMA 6″,Slow1Colour,Slow1Style);_SECTION_END();
few comments
the parameters for the MA duration should be before the MA and you need to use it in the MA otherwise there is no need for them
RangeF1=Param(“Range Fast EMA 1”,3,1,29,1);
F1=EMA(Close,RangeF1);another thing
each parameter should have unique name if you use the same for all of them they will overwrite each otherApril 3, 2016 at 12:01 pm #103493JulianCohenParticipantAh I see.(said the blind man). Thanks a lot Said. Appreciate it. I have never coded before. I can see how the code solutions can become quite elegant.
April 3, 2016 at 12:05 pm #103494SaidBitarMemberglad to help
-
AuthorPosts
- You must be logged in to reply to this topic.