lundi 18 juillet 2016

Overlay Rsi Diffrent TimeFrame

hello all and thanks for this wonderful forum
this code is overally diffrent timeframe chart
can anyone convert this code to overaly diffrent time frame RSI .
Code:

_SECTION_BEGIN("2 Timeframes Candlestick Bar Chart");
// Specially designed for use in day trading and to save chart space. This chart will displays 2 sets
// of candlestick bars. One for the time interval set for your chart- for example 1 Minute.
// The higher timeframe candlestick bars are created by using gfx low-level graphics AND will display 
// according to the parameters you set- for example 5 minutes.

// I got the idea from David's (dbwyatt_1999) 2 Timeframe chart code which was shared by him on the AmiBroker List.
// It uses TimeFrame functions with the PlotOHLC function using styleCloud. So I was thinking it would look
// very nice using low-level graphics instead. Little bit more complicated, but I got a few great pointers from Herman!

// If your chart background turns pink- please read the error message in the upper left corner of the chart.
// Then please observe this AFL code uses ColorBlend(ColorFrom, ColorTo, Factor) which was introduced in Version 5.21 beta.
// The rules are simple- time frames from 1 up to 60 minutes AND Lower time frame must be smaller than the Higher time frame.

Version(5.21);
SetChartOptions(2, chartShowDates);
Title = Name();
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// PARAMETERS AND SETTINGS:
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ChartLum                = Param("Chart Background Color Intensity", 0.40, 0, 1, 0.01);
TFMinShort                = Param("Short Timeframe (Minutes)", 1, 1, 60, 1);
TFMinLong                = Param("Long Timeframe (Minutes)", 5, 1, 60, 1);
OnSTFBars                = ParamToggle("Short TF Bars", "Off, On", 1);
OnLTFBars                = ParamToggle("Long TF Bars", "Off, On", 1);
BarLum1                = Param("Short TF Bar Color Intensity", 0, 0, 1, 0.01);
BarLum2                = Param("Long TF Bar Color Intensity", 0.70, 0, 1, 0.01);

SetChartBkColor(ColorBlend(colorLightBlue, colorWhite, ChartLum));
// Bar Colors for the Short Timeframe candlestick bars:
LineColor                = ColorBlend(colorBlack, colorWhite, BarLum1);
UpBarColor                = ColorBlend(colorBrightGreen, colorWhite, BarLum1);
DnBarColor                = ColorBlend(colorRed, colorWhite, BarLum1);
// Bar Colors For The Long Timeframe candlestick bars:
TFLineColor        = ColorBlend(colorBlack, colorWhite, BarLum2 - 0.1);
TFUpBarColor        = ColorBlend(colorBrightGreen, colorWhite, BarLum2);
TFDnBarColor        = ColorBlend(colorRed, colorWhite, BarLum2);
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// FUNCTIONS:
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function GetVisibleBarCount()
{
 lvb = Status("lastvisiblebar");
 fvb = Status("firstvisiblebar");
 return Min( Lvb - fvb, BarCount - fvb );
}

function GfxConvertBarToPixelX( bar )
{
 lvb = Status("lastvisiblebar");
 fvb = Status("firstvisiblebar");
 pxchartleft = Status("pxchartleft");
 pxchartwidth = Status("pxchartwidth");
 return pxchartleft + bar  * pxchartwidth / ( Lvb - fvb + 1 );
}

function GfxConvertValueToPixelY( Value )
{
 local Miny, Maxy, pxchartbottom, pxchartheight;
 Miny = Status("axisminy");
 Maxy = Status("axismaxy");
 pxchartbottom = Status("pxchartbottom");
 pxchartheight = Status("pxchartheight");
 return pxchartbottom - floor( 0.5 + ( Value - Miny ) * pxchartheight/ ( Maxy - Miny ) );
}

StaticVarKey = Name();
procedure xStaticVarSet(SName, SValue)
{
 global StaticVarKey;
 if (StaticVarKey != "")
        StaticVarSet(Sname + StaticVarKey, Svalue);
}
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// MAIN PROGRAM:
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
if(Interval() != TFMinShort * 60)
{
 Title = Title + "\n" + "\n" + "ALERT, ALERT, ALERT!!!" + "\n" + "Set the chart time Interval to: " + NumToStr(TFMinShort, 1.0, 1) +
                                        " Minute(s) or change the Short Timeframe Parameter setting.";
 OnSTFBars                = 0;
 OnLTFBars                = 0;
 SetChartBkColor(colorRose);
}

if(TFMinShort >= TFMinLong)
{
 Title = Title + "\n" + "\n" + "ALERT, ALERT, ALERT!!!" + "\n" + "The Long
Timeframe setting must be longer than the Short Timeframe!";
 OnSTFBars                = 0;
 OnLTFBars                = 0;
 SetChartBkColor(colorRose);
}

if(OnSTFBars)
{
 BarColor                = IIf(Close > Open, UpBarColor, DnBarColor);
 SetBarFillColor(BarColor);
 Plot(Close, "", LineColor, styleCandle);
}
else
 Plot(Close, "", colorBlack, styleCandle  | styleNoDraw);

TFSec = in1Minute * TFMinLong;
TimeFrameSet(TFSec);
TFOpen                        = Open;
TFHigh                        = High;
TFLow                                = Low;
TFClose                        = Close;
TFBarIndex                        = BarIndex();
TFLastBarIndex        = LastValue(BarIndex());
TimeFrameRestore();

TFOpen                        = TimeFrameExpand(TFOpen, TFSec, expandFirst);
TFHigh                        = TimeFrameExpand(TFHigh, TFSec, expandFirst);
TFLow                                = TimeFrameExpand(TFLow, TFSec, expandFirst);
TFClose                        = TimeFrameExpand(TFClose, TFSec, expandFirst);
TFBarIndex                        = TimeFrameExpand(TFBarIndex, TFSec, expandLast + 1);
TFLastBarIndex        = TimeFrameExpand(TFLastBarIndex, TFSec, expandLast + 1);

CandleTop                        = Max(TFOpen, TFClose);
CandleBottom                = Min(TFOpen, TFClose);
//============================================================================
// GFX LOW-LEVEL GRAPHICS SECTION.
// DRAWING THE LONG TIMEFRAME CANDLESTICK BARS:
//============================================================================
if(OnLTFBars)
{
 GfxSetOverlayMode(1);
 AllVisibleBars        = GetVisibleBarCount();
 fvb                                = Status("firstvisiblebar");
 ChartWidth                = GfxConvertBarToPixelX(AllVisibleBars );
 PixBar                        = ChartWidth / AllVisibleBars;
 Adjust                        = Pixbar * 0.35;
 TFMinutes                = TFMinLong / TFMinShort;
 NewTFBar                        = IIf(TFBarIndex != Ref(TFBarIndex, -1), 1, 0);
 BarInd                        = BarIndex();
 TFLastBarIndex        = LastValue(TFLastBarIndex);

 // DRAW BAR HISTORY AND THE CURRENT BAR:
 for(i = 0; i < AllVisibleBars; i++)
 {
  x1 = GfxConvertBarToPixelX(i) * NewTFBar[i + fvb] - Adjust;
  if(BarInd[i + fvb] < TFLastBarIndex AND NewTFBar[i + fvb] == 1)
        {
                Counter = 0;
                for(n = i + 1; NewTFBar[n + fvb] == 0 AND n + fvb < BarCount-1; n++)
                        Counter++;
                x2 = GfxConvertBarToPixelX(i + Counter) * NewTFBar[i + fvb] + 1 + Adjust;
        }

  if(TFBarIndex[i + fvb] == TFLastBarIndex)
        x2 = GfxConvertBarToPixelX(i + TFMinutes - 1) * NewTFBar[i + fvb] + 1 + Adjust;

  y1 = GfxConvertValueToPixelY(CandleTop[i + fvb]);
  y2 = GfxConvertValueToPixelY(CandleBottom[i + fvb]);
  yH = GfxConvertValueToPixelY(TFHigh[i + fvb]);
  yL = GfxConvertValueToPixelY(TFLow[i + fvb]);

  // Candle Body:
  GfxSelectPen(TFLineColor, 0);
  FillColor = IIf(TFOpen[i + fvb] < TFClose[i + fvb], TFUpBarColor,TFDnBarColor);
  GfxSelectSolidBrush(FillColor);
  if(y1 == y2){y1 = y1 - Adjust; y2 = y2 + Adjust;
        GfxSelectSolidBrush(TFLineColor);}
  if(x1 > 0){
                  GfxRectangle( x1, y1, x2, y2);
                  // Candle High and Low:
                  GfxSelectPen(TFLineColor, 2);
                  GfxMoveTo(x2+(x1-x2)/2, y1);
                  GfxLineTo(x2+(x1-x2)/2, yH);
                  GfxMoveTo(x2+(x1-x2)/2, y2);
                  GfxLineTo(x2+(x1-x2)/2, yL);
                  RequestTimedRefresh(0);
        }
 }
}
_SECTION_END();

i trade many years in multicharts
just like this this is multi charts and amibroker photo i explained on these picure please help and convert above code for rsi upper
timeframe .
multi charts and ami broker photo . thanks

Attached Images
File Type: png multicharts.png (29.5 KB)
File Type: png ami.png (49.1 KB)


Overlay Rsi Diffrent TimeFrame

dimanche 17 juillet 2016

zerodha limiting stock universe

Hi I use zerodha, but they limit the universe of stocks I am allowed to trade in using MIS product. (Which is dynamic and not a static list, apart from stocks which have hit a circuit or TT list)

They don't disclose the the rules of their risk management system that they use to limit this trading which is very annoying as I cannot incorporate them into backtesting of my strategies and get accurate results.

Is their a work around to this. Is there another broker, I can use who is more liberal with better market access.

Or does someone has any inkling of what these rules might be?

For advanced trading can someone recommend a better system.

Any help is appreciated.


zerodha limiting stock universe

hello all

1) Your trading/investing experience.
I have been doing paper trading for past few weeks :)

2) The number of years you have been investing or trading in the markets.
less than 1

3) Your area of interest - IPO's/secondary market/futures/options/commodities, etc.
equities/futures/commodities

4) How do you make your trading decisions.
testing few existing technical methods

5) How you discovered this forum.
google


hello all

Dividend Paying Stocks

I am creating a portfolio of long-term, cash flow paying assets. Let me give an example

Suppose we buy a residential unit. We can expect a 2% return from rental income, that is inflation hedged. It is a dependable cash flow. A bank FD will give interest every quarter, but the real value of interest will decrease over time. Not so with rental income.

I want to use the same strategy for stocks/MFs. I am looking at stocks, MFs where dividend yield is 5%plus. On top of that there has to be growth in the stock. If I can achieve that, I have created an inflation hedged cash stream. Do you know any scrips with the following criteria -

i) regular dividend paying with yield >= 5%
ii) Expectation of growth. I am not looking at phenomenal growth, but steady growth.

I would be grateful for any help received. Also, please comment on my plan

Amy


Dividend Paying Stocks

Motivewave full version help

Hi,

where can I get full version of Motivewave software?


Motivewave full version help

RSI Based Trading Mechanism ( AFL To be coded )

Hi all,

This is EOD based homework analysis for tomorrows Intraday Trading. We all are familiar with RSI trading style the conventional way based on overbought and oversold.

A little bit out of box analysis on RSI (14) , a method devised by Andrew Cardwill , saw from youtube.

It is a multi time frame RSI analysis starting from Monthly RSI value to Weekly to Daily.

Two levels are drawn on RSI - 60,40
Above 60 - BULLISH
Below 40 - BEARISH
Between 40 & 60 - Range bound.

No overbought or oversold analysis is performed here.

How to analyze this? This is purely back testing only, but you might have to coincide other factors for conclusion of analysis as well like PRICE ACTION.

Open a Monthly Chart eg ( NIFTY )



The RED vertical lines are the area which shows the RSI above 60, I am having lack of data , but for the sake of eg, you can see RSI above 60, Cool enough??

After marking the MONTHLY RSI REGION, look for the same on WEEKLY chart.



Now the blue vertical lines are the Weekly RSI above 60 levels. obviously on weekly timeframe, you will get ABOVE 60 factor way before it shows up on Monthly Timeframe and exits way before it shows up on Monthly chart.

We marked weekly RSI above 60 now.

Now we switch the time frame to Daily Chart and this is were we look for an entry. Now we know that Price is in Uptrend and we wanna take a BUY trade on the DIP ( which most of the fella traders fail here , while trying to BUY the DIP)



Now as per Andrew , on a daily time frame , the RSI value will bounce at every LEVEL 40 as this tends to be SUPPORT for a BULLISH market on a DIP

RSI value will repel back at every LEVEL 60 on a downtrend over the rally.

So, we are gonna participate on LEVEL 40 Dips, RSI Oscillates and touches LEVEL 40 and shoots up, upon next candle, we can go for LONG. This is his cardinal rule.

But, I have seen price mostly repel at LEVEL 50 as well, which is also a good level. Those marked regions are the levels which can let traders analyze the entry point, He or She can confirm with other mode of entry as well as in Candle formation or trendline break.

A trendline break on RSI will give you a leading entry rather than Price Trendline break. EG



The green market areas along with green trendline breaks are entry points after touching the LEVEL 40 or 50 respectively. So if there had been huge volume on break out, we can see the same on next day as well with momentum being BULLISH and most of the times, a gap up happens and we can use the 5 Minute Intraday system that was on other thread.

So, in order to get or filter the particular stocks, an AFL is required for scanning, obviously by the coders of this community, who are serving for the good of the fella traders. Kindly have a look at the methodology. It would be good if we can have a format as in follows. Just to analyze the RSI and give the value of it.



RSI setting - 14

All the Stocks in F&O or watchlist to be analyzed and RSI value on three timeframes to be resulted out.

FYI ALL : This kinda filtering can be used purely on Intraday as well with 1Hr,15MIN,5MIN Chart. But to arrive this level, one needs to filter which stock passes the Daily time frame.

From here, it can be converted to Excel and can be filtered for good purpose.
This is not a trading strategy, it is just a filtering mechanism for the good.

Hope everyone can benefit out of it.

Regards to all.


RSI Based Trading Mechanism ( AFL To be coded )

fibonacci pivot point

cant find a perfect fibonacci pivot so i make one

PHP Code:

_SECTION_BEGIN("megatrader");
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=Param("GraphXSpace",-10,0,100,1);
    
dec = (Param("Decimals",2,0,7,1)/10)+1;
SetChartBkColor(ParamColor("Outer Panel"colorBlack));
SetChartBkGradientFill(ParamColor("Upper Chart"colorDarkGrey), ParamColor("Lower Chart"colorDarkGrey));

Title EncodeColor(55)+  Title Name() + "     " EncodeColor(32) + Date() +
"      " EncodeColor(5) + "  " +
    
EncodeColor(55)+ "     Open = "EncodeColor(52)+ WriteVal(O,dec) +
    
EncodeColor(55)+ "     High = "EncodeColor(5) + WriteVal(H,dec) +
    
EncodeColor(55)+ "      Low = "EncodeColor(32)+ WriteVal(L,dec) +
    
EncodeColor(55)+ "    Close = "EncodeColor(7)+ WriteVal(C,dec)+
    
EncodeColor(55)+ "    Volume = "EncodeColor(11)+ WriteVal(V,1);
///////////////////////
colorHighliter IIf(>= OColorRGB(01280), ColorRGB(12800));
DemandPoint = (Ref(L, -1) < Ref(L, -2)) & (Ref(L, -1)) & (Ref(L1)) & (Ref(L1) < Ref(L2));

//Supply Point
//colorSupplyPoint = ParamColor("Supply Line", ColorRGB(255, 128, 0));
SupplyPoint = (Ref(H, -1) > Ref(H, -2)) & (Ref(H, -1)) & (Ref(H1)) & (Ref(H1) > Ref(H2));

CountTrendBars 0;
CurrentBar BarCount 1;
dx0 dx1 dy0 dy1 0;
sx0 sx1 sy0 sy1 0;
//Price
SetBarFillColor(colorHighliter);
Plot(C"Close"IIf(colorHighliter == ColorRGB(1280128), ColorRGB(2550255), IIf(colorHighliter == ColorRGB(1281280), ColorRGB(2552550), IIf(OColorRGB(02550), IIf(OColorRGB(25500), ColorRGB(255255255))))), styleCandleNullNull001);

Plot(EMA(Close,200),"",colorWhite );




//////////////////////////////////////////////////////////
_SECTION_END();_SECTION_BEGIN("FIBONACCI HIGH PROBABILITY ZONES");

ShowFibHiProbZone=ParamToggle("Show FIb High-Probability Zone","No|Yes",1);
HpzColor ParamColor("Line Color",colorWhite);
Periodicity inDaily;

if(
ShowFibHiProbZone AND Interval()<inHourly)
{
Periodicity inDaily;
}
else if(
ShowFibHiProbZone AND Interval()==inHourly)
{
Periodicity inWeekly;
}
else if (
ShowFibHiProbZone AND Interval()>=inDaily AND Interval()<inMonthly)
{
Periodicity inMonthly;
}
else if(
ShowFibHiProbZone AND Interval()>inWeekly AND Interval()<inYearly)
{
Periodicity inYearly;
}
else 
// Default just to silence the compiler. This will never occur.
{
Hi=Ref(H,-1);
Lo=Ref(L,-1);
Cl=Ref(C,-1);
}
Hi=TimeFrameGetPrice("H",Periodicity,-1);
Lo=TimeFrameGetPrice("L",Periodicity ,-1);
Cl=TimeFrameGetPrice("C",Periodicity ,-1);


p=(Hi+Lo+Cl)/3;

//Bands
as1b=p-((Hi-Lo)*0.382);
as2b=p-((Hi-Lo)*0.618);
as3b=p-((Hi-Lo)*1.000);
as4b=p-((Hi-Lo)*1.382);

ar1b=((Hi-Lo)*0.382)+p;
ar2b=((Hi-Lo)*0.618)+p;
ar3b=((Hi-Lo)*1.000)+p;
ar4b=((Hi-Lo)*1.382)+p;

extnd=0;
sty=styleNoLabel|styleStaircase|styleDashed|styleNoRescale;
Plot(ar1b,"",colorRed,styleDashed,styleNoRescale);
Plot(ar2b,"",colorRed,styleDashed,styleNoRescale);
Plot(ar3b,"",colorRed,styleDashed,styleNoRescale);
Plot(ar4b,"",colorRed,styleDashed,styleNoRescale);

Plot(p,"",colorOrange,styleLine,styleNoRescale);
Plot(as1b,"",colorGreen,styleDashed,styleNoRescale);
Plot(as2b,"",colorGreen,styleDashed,styleNoRescale);
Plot(as3b,"",colorGreen,styleDashed,styleNoRescale);
Plot(as4b,"",colorGreen,styleDashed,styleNoRescale);


///////////////////////
FS=Param("MM Price Font Size",20,11,100,1);
Hor=Param("MM Price Horizontal Position",840,1,1200,1);
Ver=Param("MM price Vertical Position",10,1,830,1); 

  
GfxSelectFont("tahoma"FS700True ); 
   
GfxSetBkMode);  
   
GfxSetTextColorcolorLime); 
   
GfxTextOut(""+CHor+29 Ver);
   
YC=TimeFrameGetPrice("C",inDaily,-1);
   
DD=Prec(C-YC,2);
   
xx=Prec((DD/YC)*100,2);
  
GfxSelectFont("tahoma"11700True ); 
  
GfxSetBkMode);  
  
GfxSetTextColor(7); 
   
GfxTextOut(""+DD+"  ("+xx+"%)"Hor+29 Ver+29 );
//////////////////////////////////////////////////////////
///////////////////////////////////////////// 



fibonacci pivot point