Simple Coding Help - No Promise.

Dear Sir

I want sum modification for the below code sir

SetBarFillColor(IIf(C > O, GetChartBkColor(), colorRed));
Plot( C, "Close", IIf(C > EMA(C,50), colorGreen, colorRed), styleCandle | styleNoTitle);

condition 1. ema close 50 above buy signal with backgroud colour green buy candle above only buy signal Generate

condition 2. ema close 50 below sell signal with backgroud colour red sell candle below only sell signal Generate

condition 3. suppose buy signal Generate only backgroud green and last candle high broken only generate

condition 4. suppose buy/sell signal generate bckground red but candle green
no generate the signal

waiting for your reply

thanks and regards
I can understand only small fraction of what you've written and hence dealt with condition 1 and 2 and background color manipulation. Rest of the AFL needs to be written by your own selves.

Code:
EMA50 = EMA(Close, 50);
C1 = Cross(Close, EMA50);
C2 = Cross(EMA50, Close);
XX = High > ValueWhen(C1, High);
YY = ExRem(Low < ValueWhen(C2, Low), XX);
XX = ExRem(XX, YY);
SetChartBkColor(SelectedValue(IIf(BarsSince(XX) < BarsSince(YY), colorGreen, colorRed)));
 
Thanks but I prefer not to get involved in argument type threads and whatever it is that you want to do has not been explained in straight-forward manner.
Hey mm, right now I want to parse dynamic array in plottext function .
Code:
SetOption("NoDefaultColumns", True );

Plot(C, "",colorLightGrey, styleCandle) //For seeing chart

AddColumn( Null, "Symbol", 1, colorDefault, colorDefault, 70 );
AddColumn( Null, "DateTime", 1, colorDefault, colorDefault, 150 );
AddColumn( Null, "bar", 1, colorDefault, colorDefault, 70 );



dt = DateTime();
 filter = 0;

for(i=1; i<=10; i++) {

   TimeframeSet(i * in1Minute);

   up= (ABS(O - C ) <= ((H - L ) * 0.1))

   bar= Name() + "\t";
   bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t";


   x= StrFormat("%02g-min", i);
   bar = bar+ WriteIf(up,  x, "\t");


        addRow(bar );

  TimeframeRestore();
m1 = TimeFrameExpand(up,in1Minute);

}

for(b=0; b<BarCount;, b++)
{
 if(up[b] == True) PlotText(":",b + WriteVal(up),colorAqua, bkcolor =colorDefault);
}

PlotShapes(up*shapeSmallCircle,colorGreen,0,Low,-20);
Do i need to add Writeval() function in plot?
Can you tell me, what should be correct line for plottext?

question:http://www.traderji.com/software/101822-need-your-help-multitimeframe-3.html#post1157481

Kindly tell me, why question is not straight forward? I used picture also to explain it. tell me, which are you not understanding, i will explain it.
regards
 
Last edited:
Hey mm, right now I want to parse dynamic array in plottext function .
Code:
SetOption("NoDefaultColumns", True );

Plot(C, "",colorLightGrey, styleCandle) //For seeing chart

AddColumn( Null, "Symbol", 1, colorDefault, colorDefault, 70 );
AddColumn( Null, "DateTime", 1, colorDefault, colorDefault, 150 );
AddColumn( Null, "bar", 1, colorDefault, colorDefault, 70 );



dt = DateTime();
 filter = 0;

for(i=1; i<=10; i++) {

   TimeframeSet(i * in1Minute);

   up= (ABS(O - C ) <= ((H - L ) * 0.1))

   bar= Name() + "\t";
   bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t";


   x= StrFormat("%02g-min", i);
   bar = bar+ WriteIf(up,  x, "\t");


        addRow(bar );

  TimeframeRestore();
m1 = TimeFrameExpand(up,in1Minute);

}

for(b=0; b<BarCount;, b++)
{
 if(up[b] == True) PlotText(":",b + WriteVal(up),colorAqua, bkcolor =colorDefault);
}

PlotShapes(up*shapeSmallCircle,colorGreen,0,Low,-20);
Do i need to add Writeval() function in plot?
Can you tell me, what should be correct line for plottext?

regards
PlotText(":" + up, b, up, colorAqua)

should do the printing of the values in up array

I do not even comprehend what is it that you are trying to do with the loop. What do you even mean by Dynamic Array? What do you mean by Parsing?

PlotText is not the function where you'd be doing any parsing whatsoever. That function is simply meant for displaying text on screen and every parameter of the function is a simple scalar.
 
should do the printing of the values in up array

I do not even comprehend what is it that you are trying to do with the loop. What do you even mean by Dynamic Array? What do you mean by Parsing?

PlotText is not the function where you'd be doing any parsing whatsoever. That function is simply meant for displaying text on screen and every parameter of the function is a simple scalar.
Hey mm,
thanks,
http://www.traderji.com/software/101822

-need-your-help-multitimeframe-3.html#post1157481


I explained it on that link.

BAsically i want a exploration output under candlestick, later i come to know that i don't need to do exploration to get same value on candlestick.

usually in plottext() used for pattern explorer of candlestick and print something .. like bullish engulfing, bearish engulfing, shooting star, when such pattern are on chart, it put such name..

So name like bullish engulfing, bearish engulfing, shooting star, it's fixed.

dynamic array i said because array that's not fixed. we don't know what values going to be in it.

basically i wanted exploration output under candlestick.. and it's not fixed or predefined.

If you have time, look for upper link, and use this exploration code. you'll know it.

Kindly tell me, if any problem is there.
If you understood question, Kindly change it exploration code.

regards
 

amitrandive

Well-Known Member
Happy Bhai,
Need small favor-
Can you code Zigzag for Amibroker.The Zigzag is a tool in MT4 and it works like a charm on Stock Futures.
Zigzag connects the high and low of the candles.



Basic Indicator in Amibroker,beware it looks to the future.

https://www.amibroker.com/guide/afl/zig.html

An example of this

http://www.w isest ocktrader.com/indicators/881-zig-zag-indicator-with-valid-entry-and-exit-points
 
Last edited:

Similar threads