Simple Coding Help - No Promise.

Priya

I appreciate that you know ,that no AFL works 100% all the time and in all markets.

Any AFL is based on a system and a set of rules.If you already have these rules defined,you should not need an AFL to trade.

Still you can search for 315 system AFL,and many such more in this forum.
Believe me when I say , that even if you get the best trading system in the world,without discipline , you will surely make losses.

Trading is not about getting the best AFL's, you need to understand a lot of things to be able to trade Intraday profitably.

Simple 20 EMA and support resistance system works wonders.
Yet many don't believe this system is profitable due to its simplicity.

15 min chart of BankNifty(Spot)


Sir,
Thanks for your advice
PriyaRamesh
 

Nehal_s143

Well-Known Member
Hi

I have earth afl, I want to use it on 10 min time frame, i tried several times using time frame expand, but still 10 min ribbon is not plotting correctly

Please correct 10 min. TF

Code:
_SECTION_BEGIN("10min Earth");
tf=Param("Time Frame (min)",10,1,10,1);tfrm=in1Minute*tf;
TimeFrameSet(tfrm);

VarT2	= ( High + Low + Close * 2 ) / 4;
BT2		= (EMA((VarT2 - LLV(VarT2,15))/(HHV(Low, 15) - LLV(VarT2, 15)), 2)) * 38;
BotT2	= (((-1)) * (EMA( (VarT2- LLV(VarT2,15) ) / (HHV(Low, 15)-LLV(VarT2, 15)), 2) + 0.01)) * 38;
Var2T2	= ((Close-LLV(Low, 10))/(HHV(High, 10)-LLV(Low, 10))) * 100;
Var3T2	= EMA(Var2T2, 10);
Var4T2	= EMA(Var3T2, 10);
Var5T2	= 3 * Var3T2 - 2 * Var4T2;
Var6T2	= EMA(Var5T2, 5);
BridgeT2 = EMA(Var6T2, 1);

TimeFrameRestore() ;

BridgeT2f = TimeFrameExpand(BridgeT2, tfrm);

myc2e=IIf(BridgeT2f > Ref(BridgeT2f, -1),colorBlue,
     IIf(BridgeT2f < Ref(BridgeT2f, -1),colorRed,31));

Plot(6, "ribbon", myc2e, styleOwnScale | styleArea|styleNoLabel, 0.1, 100);
_SECTION_END();

_SECTION_BEGIN("Earth-2");
VAR2=(High+Low+(Close)*(2))/(4);
B = ((EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))*(38));
//Plot(b, "", 4, 1+4);
bot1 = ((((-1))*(EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))+0.01)*(38));
//Plot(bot1, "", 4, 1+4);
VAR22=((Close-LLV(Low,10))/(HHV(High,10)-LLV(Low,10)))*(100);
VAR33=EMA(VAR22,10);
VAR44=EMA(VAR33,10);
VAR55=(3)*(VAR33)-(2)*(VAR44);
VAR66=EMA(VAR55,5);
BridgeT = (EMA(VAR66,1));
Plot(bridget, "", IIf(bridget > Ref(bridget,-1),colorBlue,colorRed), 1+4);
Plot(-bridget, "", IIf(bridget > Ref(bridget,-1),colorBlue,colorRed), 1+4);

myc=IIf(BridgeT > Ref(BridgeT, -1),colorBlue,
    IIf(BridgeT < Ref(BridgeT, -1),colorRed,31));

//Plot(12, "ribbon", myc, styleOwnScale| styleArea|styleNoLabel,-0.5,100);

Plot(0,"",colorYellow,styleLine);

_SECTION_END();
 
Hi

I have earth afl, I want to use it on 10 min time frame, i tried several times using time frame expand, but still 10 min ribbon is not plotting correctly

Please correct 10 min. TF

Code does not have plot line. Also for it to plot on 10 Min, you will have to watch the chart in TF below 10 mins not higher.
 
i have its dll file but when i put dll file it give amibroker exit error
Obviously the DLL is cooked one and it is forcing Amibroker to quit.
 
Sir I want to see only ribbon and want to use 10 min TF code in buy sell condition, will be using this afl only on 5 min chart and dont want to use on higher TF
What exactly is the problem?. "Not correct" means what exactly?.. Just so you know, I have no idea about this AFL but I've heard the name. My objective is to just figure out any simple coding error if I can.
 

Nehal_s143

Well-Known Member
What exactly is the problem?. "Not correct" means what exactly?.. Just so you know, I have no idea about this AFL but I've heard the name. My objective is to just figure out any simple coding error if I can.

sir please see attached images

actual ribbon of 10 min which should appear as it is on 5 min, but on 5 min chart ribbon is very different then 10 min chart
 
Last edited:

extremist

Well-Known Member
sir please see attached images

actual ribbon of 10 min which should appear as it is on 5 min, but on 5 min chart ribbon is very different then 10 min chart
Please replace the First part in your code by the code following.

Code:
_SECTION_BEGIN("10min Earth");
tf=Param("Time Frame (min)",10,1,10,1);tfrm=in1Minute*tf;
TimeFrameSet(tfrm);

VarT2	= ( High + Low + Close * 2 ) / 4;
BT2		= (EMA((VarT2 - LLV(VarT2,15))/(HHV(Low, 15) - LLV(VarT2, 15)), 2)) * 38;
BotT2	= (((-1)) * (EMA( (VarT2- LLV(VarT2,15) ) / (HHV(Low, 15)-LLV(VarT2, 15)), 2) + 0.01)) * 38;
Var2T2	= ((Close-LLV(Low, 10))/(HHV(High, 10)-LLV(Low, 10))) * 100;
Var3T2	= EMA(Var2T2, 10);
Var4T2	= EMA(Var3T2, 10);
Var5T2	= 3 * Var3T2 - 2 * Var4T2;
Var6T2	= EMA(Var5T2, 5);
BridgeT2 = EMA(Var6T2, 1);
myc2e=IIf(BridgeT2 > Ref(BridgeT2, -1),colorBlue,IIf(BridgeT2 < Ref(BridgeT2, -1),colorRed,31));

TimeFrameRestore() ;

BridgeT2f = TimeFrameExpand(BridgeT2, tfrm);

myc2ef=TimeFrameExpand(myc2e, tfrm);

Plot(6, "ribbon", myc2ef, styleOwnScale | styleArea|styleNoLabel, 0.1, 100);
_SECTION_END();
This will solve your purpose.

But as u said u have no purpose except learning to solve the error

Here is the Explanation :

a). Bookish / Veteran Explanation :

Use HTF Variable in calculation when TF is set on HTF.

b). Simple Indepth explanation for normal human beings like me. :)

As in your code u have expanded the Higher Time frame (HTF) on Lower Time Frame (LTF).

For this u have expanded the variable "BridgeT2" to "BridgeT2f"
So u will have two bars of 5M in 1 bar of 10M.
and for coloring purpose u directly used expanded variable. so as per your coloring condition when the ref value is equal to current value (Comparing the two parts of one flat line of 10M) it is giving grey color output.

I hope u got it.
 
Last edited:

Similar threads