Supply and demand

has anybody coded the supply and demand with base candle of %50 or less and is it any good.

I m trying to code it… lets see how it works.

[entire system code is not advisable as so many rules under different time frames
semi automated code using rectangle and studyID is best]

//Base candle code

tmp1=abs((High-Low))/2;
tmp2=abs((Open-Close));
BaseCandleColor=ParamColor(“BaseCandleColor”,colorWhite);

setbarFillColor(IIf(tmp2<=tmp1 ,BaseCandleColor,IIf(C<=O,colorRed,colorBlue)));
Plot(C,“Price”,IIf(C>O,ColorRGB(0,0,255),IIf(C<=O,ColorRGB(240,0,0),colorDefault)),64,0,0,0,0,1);

----->>>>set last option [ use one color for entire candle and hollow body for up candle ] under bars&candles tab setting under preference

@sandeep Is it really that difficult to enter the AFL code properly? Improperly formatted code might result in syntax errors. Your short code is a good example. This is what you get if you copy paste your above code to AmiBroker:

Przechwytywanie


... and that is how your code should look like:

tmp1=abs((High-Low))/2;
tmp2=abs((Open-Close));
BaseCandleColor=ParamColor("BaseCandleColor",colorWhite);

setbarFillColor(IIf(tmp2<=tmp1 ,BaseCandleColor,IIf(C<=O,colorRed,colorBlue)));
Plot(C,"Price",IIf(C>O,ColorRGB(0,0,255),IIf(C<=O,ColorRGB(240,0,0),colorDefault)),64,0,0,0,0,1);

Read here:

3 Likes

I have just copied from afl formula editor and pasted here. where is properly formatted thing comes ?

@sandeep at the top of each page on the forum is a link on how to use this site. @Milosz also posted the link. Read the section with the heading “Enter the AFL code properly” and that will show you the ways to enter your AFL code with the correct formatting.

2 Likes

hi
you wrote that you were trying to code the supply and demand ,did you get any where and if so would you like to share it.