Simple Coding Help - No Promise.

Could anyone help me getting SHORT SELL and BUY TO COVER signals in my code where BUY and SELL are generated but short sell signal is not generated. So I cant test the startegy in Amibroker backtesting as it gives results only for Buy trades. Help appreaciated. Also please tell me how do I send the code. God Bless You . Regards
Easy!, simply add two lines at the end of the AFL

Short = Sell;
Buy = Cover;

Its not 100% accurate, but it will allow you to execute full back testing
 

Nehal_s143

Well-Known Member
I don't see any flicker... Maybe I am not seeing it same context as you are.

Anyways, there are few things that may be done to minimise the flicker

1) Use SetBarsRequired(sbrAll) at the start.
2) Experiment with ExpandFirst in the TimeFrameExpand functions....
3) Instead of Close price, use relatively stable prices such as Open, High Low or any averaged out permutation thereof.

Suggestion #3 is a paradigm shift
Thank you sir,

SetBarsRequired( sbrAll, sbrAll );

added above code to afl, after which values are not changing during scrolling

Thank you once again :thumb:
 

Aman1

Well-Known Member
Can someone help with this--

1. when macd histogram ticks up color of candle = Blue
2. when macd ticks up color of candle = orange
3. when macd cross color of candle = Green
4. when macd histogram ticks down color of candle = blue
5. when macd ticks down color of candle = orange
6. when macd cross down color of candle = Red
 

amitrandive

Well-Known Member
I require a AFL which
** plot Lines at crossover candle for EMA5>EMA8 BULL condition.
1) Draw Lines at HIGH and LOW of this Bull Crossover candle.
* Buy Condition 1 = Buy when the candle close above Bull High Line.
* Sell Condition 1 = Sell when the candle close below Bull Low Line.

** plot Lines at crossover candle for EMA5<EMA8 BEAR condition.
2) Draw Lines at HIGH and LOW of this Bear Crossover candle.
* Buy Condition 2 = Buy when the candle close above Bear High Line.
* Sell Condition 2 = Sell when the candle close below Bear Low Line.

So, only one signal should be in live at any point of time. If Condition 1 active then past signal of Condition 2 should be inactive and vice verse.

Please Help.
Need expert help here.
 
Guys.. plz convert this amibroker afl to Metatrader programm..

Plz guys.. its urgent...

thanks in advance.. im not getting any reply's in my thread.. so im coming back to this thread which helped me in past.

_SECTION_BEGIN("SMART TRADING SYSTEM ");
GraphXSpace = 15;
A = DEMA(C,2);
BH = DEMA(a,34)+2*(StDev(a,34));
BL = DEMA(a,34)-2*(StDev(a,34));
BM = (BH+BL)/2;
Highs = TEMA(High, 30);
Lows = TEMA(Low, 30);
A = DEMA(L,2);
BH = DEMA(A,34)+2*(StDev(A,34));
BL = DEMA(A,34)-2*(StDev(A,34));
BM = (BH+BL)/2;
A = DEMA(H,2);
BH = DEMA(A,34)+2*(StDev(A,34));
BL = DEMA(A,34)-2*(StDev(A,34));
UpTrend = C > Highs;
DnTrend = C < Lows ;
BM1 = (BH+BL)/2;
Sell=Cross(BM,C);
Buy=Cross(C,BM1);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PlotShapes(IIf(Buy, shapeHollowUpArrow, shapeNone),colorGreen, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeHollowDownArrow, shapeNone),colorRed, 0, H, Offset=-15);Colors = IIf(UpTrend, colorGreen, IIf(DnTrend, colorRed, colorLightGrey));
Plot(Close, "Price", Colors, styleCandle | styleThick);

guys plz help.....
 
Hi Seniors,

In following code i need some help...it plot buy and sell arrow each time it breaks from prv.Hi/Low... i want it only first time breakout signal and not repeat signal...

SetChartOptions(0,chartShowArrows|chartShowDates);

H1= TimeFrameGetPrice("H",inDaily,-1);

L1= TimeFrameGetPrice("L",inDaily,-1);


Buy = Cross(H,H1);
AlertIf( Buy, "", "Brk Prv Hi", 4 );

Sell = Cross(L1,L);
AlertIf( Sell, "", "Brk Prv Lo", 4);


PlotShapes( IIf( Buy, shapeUpArrow , shapeNone ), colorBlack );
PlotShapes( IIf( Sell, shapeDownArrow , shapeNone ), colorCustom12 );


Regards,
Kedarnath
 

Similar threads