My visual effect afl collection.

yasu222

Active Member
#62
Pushbullet short,cover code

_SECTION_BEGIN("PushBullet");

EnableScript("VBScript");

<%

Public Sub pushbullet(Message_Text)
Dim Message

'Your Message
Message = Message_Text

Dim objXmlHttpMain , URL

strJSONToSend = "{""type"": ""note"", ""title"": ""Alert"", ""body"":""" &Message_Text&"""}"

URL="https://api.pushbullet.com/v2/pushes"
Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP")
on Error resume next
objXmlHttpMain.open "POST",URL, False
objXmlHttpMain.setRequestHeader "Authorization", "Bearer xxxxxxxxxxxxxxxxxxxxxx"
objXmlHttpMain.setRequestHeader "Content-Type", "application/json"


objXmlHttpMain.send strJSONToSend

set objJSONDoc = nothing
set objResult = nothing

'Store response
'msgbox(objXmlHttpMain.responseText)
'response.Write (objXmlHttpMain.responseText)
alert("Hi")
End Sub

%>

pb = GetScriptObject();



if (LastValue(ValueWhen(Ref(Buy,-1),BarIndex())==BarIndex()) AND StaticVarGet(Name()+GetChartID()+"buyAlert")==0 )
{
pb.PushBullet("Buy Alert in " +Name() + " : BuyPrice Value is " + BuyPrice + " Time " + TimeNum());
StaticVarSet(Name()+ GetChartID() + "buyAlertBar", LastValue(TimeNum()));
}

if (LastValue(TimeNum()) == StaticVarGet(Name()+GetChartID()+"buyAlertBar"))

StaticVarSet(Name()+GetChartID()+"buyAlert",1); //alert was triggered, no more alerts on this bar
else
StaticVarSet(Name()+GetChartID()+"buyAlert",0); // new bar formed, and alerts can be trigered.

if (LastValue(ValueWhen(Ref(Sell,-1),BarIndex())==BarIndex()) AND StaticVarGet(Name()+GetChartID()+"sellAlert")==0 )
{
pb.PushBullet("Sell Alert in " +Name() + " : SellPrice Value is " + SellPrice + " Time " + TimeNum());
StaticVarSet(Name()+ GetChartID() + "sellAlertBar", LastValue(TimeNum()));
}

if (LastValue(TimeNum()) == StaticVarGet(Name()+GetChartID()+"sellAlertBar"))

StaticVarSet(Name()+GetChartID()+"sellAlert",1); //alert was triggered, no more alerts on this bar
else
StaticVarSet(Name()+GetChartID()+"sellAlert",0); // new bar formed, and alerts can be trigered.


if (LastValue(ValueWhen(Ref(Cover,-1),BarIndex())==BarIndex()) AND StaticVarGet(Name()+GetChartID()+"buyAlert")==0 )
{
pb.PushBullet("cover Alert in " +Name() + " : BuyPrice Value is " + CoverPrice + " Time " + TimeNum());
StaticVarSet(Name()+ GetChartID() + "coverAlertBar", LastValue(TimeNum()));
}

if (LastValue(TimeNum()) == StaticVarGet(Name()+GetChartID()+"coverAlertBar"))

StaticVarSet(Name()+GetChartID()+"coverAlert",1); //alert was triggered, no more alerts on this bar
else
StaticVarSet(Name()+GetChartID()+"coverAlert",0); // new bar formed, and alerts can be trigered.

if (LastValue(ValueWhen(Ref(Short,-1),BarIndex())==BarIndex()) AND StaticVarGet(Name()+GetChartID()+"ShortAlert")==0 )
{
pb.PushBullet("Short Alert in " +Name() + " : ShortPrice Value is " + ShortPrice + " Time " + TimeNum());
StaticVarSet(Name()+ GetChartID() + "ShortAlertBar", LastValue(TimeNum()));
}

if (LastValue(TimeNum()) == StaticVarGet(Name()+GetChartID()+"ShortAlertBar"))

StaticVarSet(Name()+GetChartID()+"ShortAlert",1); //alert was triggered, no more alerts on this bar
else
StaticVarSet(Name()+GetChartID()+"ShortAlert",0); // new bar formed, and alerts can be trigered.


_SECTION_END();
 

yasu222

Active Member
#63
Stochastick_sys

//MAGIC_STICK_SYS//
Periods = Param( "Periods", 8, 8, 140, 1 );
Ksmooth = Param("%K smooth", 3, 2, 50, 1 );
Dsmooth = Param("%D smooth", 3, 2, 50, 1 );

Buy1 = Cross( StochK (Periods,Ksmooth), StochD (Periods,Ksmooth,Dsmooth)) AND (Ref(StochK (Periods,Ksmooth),-1)<=Ref(StochD (Periods,Ksmooth,Dsmooth),-1));
Sell1 = Cross( StochD(Periods,Ksmooth,Dsmooth), StochK(Periods,Ksmooth) ) AND (Ref(StochK (Periods,Ksmooth),-1)>=Ref(StochD (Periods,Ksmooth,Dsmooth),-1));

Buy=ExRem(Buy1,Sell1);
Sell=ExRem(Sell1,Buy1);
Short=Sell ;
Cover=Buy;
PlotShapes(Buy*shapeUpArrow,colorBrightGreen,0,L,-25);
PlotShapes(Sell*shapeDownArrow,colorPink,0,H,-20);

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//optimization//
Periods = Optimize( "Periods", 8, 8, 140, 1 );
Ksmooth = Optimize("%K smooth", 3, 2, 50, 1 );
Dsmooth = Optimize("%D smooth", 3, 2, 50, 1 );

Buy1 = Cross( StochK (Periods,Ksmooth), StochD (Periods,Ksmooth,Dsmooth)) AND (Ref(StochK (Periods,Ksmooth),-1)<=Ref(StochD (Periods,Ksmooth,Dsmooth),-1));
Sell1 = Cross( StochD(Periods,Ksmooth,Dsmooth), StochK(Periods,Ksmooth) ) AND (Ref(StochK (Periods,Ksmooth),-1)>=Ref(StochD (Periods,Ksmooth,Dsmooth),-1));

Buy=ExRem(Buy1,Sell1);
Sell=ExRem(Sell1,Buy1);
Short=Sell ;
Cover=Buy;
 
Last edited:

yasu222

Active Member
#65
_SECTION_BEGIN("NAKED_RSI");
//NAKED_RSI //
pr = Param("periods",14,1,200,3);
refl = Param("Magnet Line",5,1,100,1);
rsii = RSI(pr);
rsic = Cross(rsii,refl) OR Cross(refl,rsii);
c1 = ValueWhen(rsic,H,1);
c2 = ValueWhen(rsic,L,1);
c3 = C>C1;
c4 = C<c2;
Buy = ExRem(c3,c4);
Sell = ExRem(c4,c3);
PlotShapes(Buy*shapeUpTriangle,colorBlue,0,L,-25);
PlotShapes(Sell*shapeDownTriangle,colorYellow,0,H,-20);
_SECTION_END();
 

yasu222

Active Member
#66
Reading Back Test Report

Reading backtest report


Exposure % - 'Market exposure of the trading system calculated on bar by bar basis. Sum of bar exposures divided by number of bars. Single bar exposure is the value of open positions divided by portfolio equity.

Net Risk Adjusted Return % - Net profit % divided by Exposure %

Annual Return % - Compounded Annual Return % (CAR)

Risk Adjusted Return % - Annual return % divided by Exposure %

Avg. Profit/Loss, also known as Expectancy ($) - (Profit of winners + Loss of losers)/(number of trades), represents expected dollar gain/loss per trade

Avg. Profit/Loss %, also known as Expectancy (%) - '(% Profit of winners + % Loss of losers)/(number of trades), represents expected percent gain/loss per trade

Avg. Bars Held - sum of bars in trades / number of trades

Max. trade drawdown - The largest peak to valley decline experienced in any single trade. The lower the better

Max. trade % drawdown - The largest peak to valley percentage decline experienced in any single trade. The lower the better

Max. system drawdown - The largest peak to valley decline experienced in portfolio equity. The lower the better

Max. system % drawdown - The largest peak to valley percentage decline experienced in portfolio equity. The lower the better

Recovery Factor - Net profit divided by Max. system drawdown

CAR/MaxDD - Compound Annual % Return divided by Max. system % drawdown. Good if bigger than 2

RAR/MaxDD - Risk Adjusted Return divided by Max. system % drawdown. Good if bigger than 2.

Profit Factor - Profit of winners divided by loss of losers

Payoff Ratio - Ratio average win / average loss

Standard Error - Standard error measures chopiness of equity line. The lower the better.

Risk-Reward Ratio - Measure of the relation between the risk inherent in a trading the system compared to its potential gain. Higher is better. Calculated as slope of equity line (expected annual return) divided by its standard error.

Ulcer Index - Square root of sum of squared drawdowns divided by number of bars

Ulcer Performance Index - (Annual profit - Tresury notes profit)/Ulcer Index'>Ulcer Performance Index. Currently tresury notes profit is hardcoded at 5.4. In future version there will be user-setting for this.

Sharpe Ratio of trades - Measure of risk adjusted return of investment. Above 1.0 is good, more than 2.0 is very good.

K-Ratio - Detects inconsistency in returns. Should be 1.0 or more. The higher K ratio is the more consistent return you may expect from the system. Linear regression slope of equity line multiplied by square root of sum of squared deviations of bar number divided by standard error of equity line multiplied by square root of number of bars.

Color-coding in the backtest report (new in 5.60)

Version 5.60 brings enhanced backtest report: color-coding 'good' and 'bad' values in backtest report. Some of the metrics in the backtest report are color-coded. Blue means "neutral", Green means "good", Red means "bad". Metrics that are not colorized are always black.

As of now the following metrics are colorized:
Net Profit, Net Profit % - bad < 0, good > 0
Annual Profit %, bad < 0, neutral betwen 0 and 10, good > 10
RAR % bad < 0, good > (10 / Exposure)
Avg. Profit/Loss all trades (Expectancy $) - bad < 0, good > 0
Avg Profit/Loss % all trades (Expectancy %) - bad < 0, good > 0
Max. system % drawdown - bad: dd worse than -30%, neutral: dd between -30 and -10%, good - -10% to 0%
CAR/MaxDD, RAR/MaxDD - bad < 1, neutral between 1 and 2, good > 2
Recovery factor - bad < 1, neutral between 1 and 2, good > 2
Payoff ratio - bad < 1, neutral between 1 and 2, good > 2
 

yasu222

Active Member
#67
May Be useful - for reference

I created this indicator because after spending many hours working on my trading system, I find that Amibroker doesn’t have range bar timeframes in the backtester. So I developed this so I could test my system quickly and easily without using the backtester.

As for the trade condition and trade management, I created those because I had a problem with prior systems overlapping trades. So the systemstate variable prevents overlapping (i.e. having a long and short trade open at the same time) – that’s just for me, use it if you find it useful, otherwise, you can delete the trade conditions and just directly edit Buy, Sell, Short, Cover.

Lastly, there’s a very basic summary of the number of trades and the win ratio.

How to use:

Define your entry rules under LongEntry1 and ShortEntry1. If you have multiple, then create LongEntry2 and ShortEntry2, etc. Then under LongEntry and “or LongEntry2”, etc. Same applies for the exits. If you don’t have any conditions, just enter 0 (zero).

Then under LongEntryPrice and all the other prices, replace O with your price.

Explanation of the Graphs:

The TradeProfits graphs (the histogram) show the profit/loss made per trade. They are plotted about the 0 line, so anything under the 0 line is a loss. You can see at a glance your win/loss ratio.

The totals graphs show the cumulative profits/losses as and when a trade is closed. This gives you and idea of the effect of the trades on your total points/gained lost. Up is good, down is bad.


//Visual BackTest for Amibroker
//Made by Sethmo (Ipeleng Molete)
//Date Made: 8 November 2013
//Feel free to use as you wish, please acknowledge the author

SetBarsRequired(-2,0);
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

EMA1 = EMA(C, 5);
EMA2 = EMA(C, 10);

WMA1 = WMA(C, 5);
WMA2 = WMA(C, 10);

Color = colorBlack;

//----------------------------------------------------------//
// TRADE CONDITIONS
//----------------------------------------------------------//

LongEntry1 = Cross(EMA1,EMA2);
ShortEntry1 = Cross(WMA2,WMA1);

LongExit1 = Cross(EMA2,EMA1);
ShortExit1 = Cross(WMA1,WMA2);

LongEntry = LongEntry1;
ShortEntry = ShortEntry1;

LongExit = LongExit1;
ShortExit = ShortExit1;

LongEntryDate = ValueWhen(LongEntry1, DateTime());
ShortEntryDate = ValueWhen(ShortEntry1, DateTime());
LongExitDate = ValueWhen(LongExit1, DateTime());
ShortExitDate = ValueWhen(ShortExit1, DateTime());

Longtrue = Flip(Longentry, LongExit);
Shorttrue = Flip(Shortentry, Shortexit);

systemState = IIf(Shorttrue AND !Longtrue, 0, //in short trade
IIf(Longtrue AND !Shorttrue, 1, //in long trade
IIf(!Longtrue AND !Shorttrue, 2, 3)));//ready

LongEntry = LongEntry AND systemstate == 1;
ShortEntry = ShortEntry AND systemstate == 0;

//----------------------------------------------------------//
// TRADE MANAGEMENT
//----------------------------------------------------------//

Buy = LongEntry AND systemstate == 1;
Sell = LongExit;
Short = ShortEntry AND systemstate == 0;
Cover = ShortExit;

inlong = Flip(Buy, Sell);
inshort = Flip(Short, Cover);

realBuy = inlong AND !Ref(inlong, -1);
realSell = !inlong AND Ref(inlong, -1);
realShort = inshort AND !Ref(inshort,-1);
realCover = !inshort AND Ref(inshort,-1);

LongEntryPrice = ValueWhen(realBuy,O);
LongExitPrice = ValueWhen(realSell,O);
ShortEntryPrice = ValueWhen(realShort,O);
ShortExitPrice = ValueWhen(realCover,O);

BuyPrice = LongEntryPrice;
SellPrice = LongExitPrice;
ShortPrice = ShortEntryPrice;
CoverPrice = ShortExitPrice;

//----------------------------------------------------------//
// PLOTTING
//----------------------------------------------------------//
LongProfit = IIf(realSell,ValueWhen(realSell,LongExitPrice - LongEntryPrice),0);
ShortProfit = IIf(realCover,ValueWhen(realCover, ShortEntryPrice - ShortExitPrice),0);

Profit = IIf(realSell, LongProfit,
IIf(realCover, ShortProfit, 0));

TotalLP = Sum(LongProfit, Cum(1));
TotalSP = Sum(ShortProfit, Cum(1));
Total = TotalLP + TotalSP;

LongProfitColour = colorGreen;
ShortProfitColour = colorRed;
TotalColour = colorTurquoise;

LongTrades = 0;
ShortTrades = 0;
LongWinners = 0;
ShortWinners = 0;

for (i = 0; i < BarCount - 1; i++)
{
if(realSell)
{
LongTrades++;
}
if(realCover)
{
ShortTrades++;
}
if(LongProfit > 0)
{
LongWinners++;
}
if(ShortProfit > 0)
{
ShortWinners++;
}
}

LongWinPerc = (LongWinners/LongTrades)*100;
ShortWinPerc = (ShortWinners/ShortTrades)*100;
TotalTrades = LongTrades + ShortTrades;
TotalWinners = LongWinners + ShortWinners;
TotalWinPerc = (TotalWinners/TotalTrades) * 100;

printf("\nLong Trades: \t" + WriteVal(LongTrades, 1.0));
printf("\nShort Trades: \t" + WriteVal(ShortTrades, 1.0));
printf("\nLong Winners: \t" + WriteVal(LongWinners, 1.0));
printf("\nShort Winners: \t" + WriteVal(ShortWinners, 1.0));
printf("\nLong Win %%: \t" + WriteVal(LongWinPerc, 1.0) + "%%");
printf("\nShort Win %%: \t" + WriteVal(ShortWinPerc, 1.0) + "%%");
printf("\nTotal Trades: \t" + WriteVal(TotalTrades, 1.0));
printf("\nTotal Winners: \t" + WriteVal(TotalWinners, 1.0));
printf("\nTotal Win %%: \t" + WriteVal(TotalWinPerc, 1.0) + "%%");

if (ParamToggle("Show TRADE PROFITS?", "No|Yes", 0))
{
Plot(Profit, "\nTrade Profit", IIf(LongProfit, LongProfitColour, IIf(ShortProfit, ShortProfitColour, colorBlue)), styleThick | styleHistogram | styleLeftAxisScale);
Plot(0, "\n0", colorYellow, styleThick | styleLeftAxisScale);
}

if (ParamToggle("Show TOTALS?", "No | Yes", 0))
{
Plot(totalLP, "\nTotalLP", LongProfitColour, styleLine | styleOwnScale);
Plot(totalSP, "\nTotalSP", ShortProfitColour, styleLine | styleOwnScale);
Plot(total, "\nTotal", TotalColour, styleThick | styleLine | styleOwnScale);
}

Plot( C, "Close", color, styleNoTitle | styleCandle );

if (ParamToggle("Show REAL TRADES?", "No|Yes", 0))
{
PlotShapes( realBuy * shapeUpArrow, colorDarkGreen, 0, L, -50);
PlotShapes( realSell * shapeHollowDownArrow, colorDarkGreen, 0, H, -50);
PlotShapes( realShort * shapeDownArrow, colorDarkRed, 0, H, -50);
PlotShapes( realCover * shapeHollowUpArrow, colorDarkRed, 0, L, -50);
}
 

yasu222

Active Member
#68
Volatality_expert_advisor

_SECTION_BEGIN("Volatality_Expert_Advisor");
dojidiv =5;
CloseEqualOpen = ( High - Low ) / dojidiv > abs( Open - Close );
RefC = Ref( C, -1 );
RefO = Ref( O, -1 );
Up = C > O;
Down = C < O ;
UpDoji = CloseEqualOpen AND RefC > RefO;
DownDoji = CloseEqualOpen AND RefC < RefO;
colcond = IIf( up || updoji, colorBrightGreen, colorRed );
SetBarFillColor( colcond );
Plot( C, "Price", colcond, styleCandle );
/////////////////////////////////////////////////////

NDays=Param("Number of Days",2,1,11,1);
per = Param("fraction",.382,.001,20,.001);
DayC=TimeFrameGetPrice("C",inDaily,-NDays);
NDaysDHLAvg=0;
for(i=1;i<=NDays;i++)
{
DayH=TimeFrameGetPrice("H",inDaily,-NDays);
DayL=TimeFrameGetPrice("L",inDaily,-NDays);
NDaysDHLAvg=NDaysDHLAvg+(DayH-DayL);
}
NDaysDHLAvg=NDaysDHLAvg/NDays;

ADM= NDaysDHLAvg; // Average Day Moment


Buy= C>((DayC)+((per)*(ADM)));
Sell= C<((DayC)-((per)*(ADM)));

B1 = (DayC)+((per)*(ADM));
S1 = (DayC)-((per)*(ADM));
avd=IIf(C>Ref(B1,-1),1,IIf(C<Ref(S1,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,S1,B1);
// line code
Plot(tsl, _DEFAULT_NAME(), colorTan, styleLine);

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=Sell;
Cover=Buy;

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

_SECTION_END();


////////OPT_Volatality_Expert_Advisor/////////

NDays=Optimize("Number of Days",1,1,21,3);
per = Optimize("fraction",.382,.03,10,.03);
DayC=TimeFrameGetPrice("C",inDaily,-NDays);
NDaysDHLAvg=0;
for(i=1;i<=NDays;i++)
{
DayH=TimeFrameGetPrice("H",inDaily,-NDays);
DayL=TimeFrameGetPrice("L",inDaily,-NDays);
NDaysDHLAvg=NDaysDHLAvg+(DayH-DayL);
}
NDaysDHLAvg=NDaysDHLAvg/NDays;
ADM= NDaysDHLAvg; // Average Day Moment
Buy= C>((DayC)+((per)*(ADM)));
Sell= C<((DayC)-((per)*(ADM)));
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=Sell;
Cover=Buy;
 
Last edited:

yasu222

Active Member
#69
Volatality_Hourly_Expert

//Volatality_Hourly_Expert//
function vstop_func(trBull,trBear)
{
trailArray[ 0 ] = C[ 0 ]; // initialize
for( i = 1; i < BarCount; i++ )
{
prev = trailArray[ i - 1 ];

if (C[ i ] > prev AND C[ i - 1 ] > prev)
{
trailArray[ i ] = Max(prev,C[ i ] - trBull[ i ]);
}
else if (C[ i ] < prev AND C[ i - 1 ] < prev)
{
trailArray[ i ] = Min(prev,C[ i ] + trBear[ i ]);
}
else if (C[ i ] > prev)
{
trailArray[ i ] = C[ i ] - trBull[ i ];
}
else
{
trailArray[ i ] = C[ i ] + trBear[ i ];
}
}
return trailArray;
}
NHours=Param("Number of Hours",5,1,11,1);
per = Param("fraction",3,.001,5,.001);
HC=TimeFrameGetPrice("C",NHours*inHourly,-NHours);
NHoursDHLAvg=0;
for(i=1;i<=NHours;i++)
{
HourH=TimeFrameGetPrice("H",NHours*inHourly,-NHours);
HourL=TimeFrameGetPrice("L",NHours*inHourly,-NHours);
NHoursDHLAvg=NHoursDHLAvg+(HourH-HourL);
}
NHoursDHLAvg=NHoursDHLAvg/NHours;

ADM= NHoursDHLAvg; // Average Day Moment


trBull = ((per)*(ADM));
trBear = ((per)*(ADM));

trailArray = vstop_func(trBull,trBear);

SetChartBkColor( ParamColor("ColorBG", ColorRGB( 0, 0, 0 ) ) );
GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(IIf(trailArray >
C,trailArray,Null),"\ntrailShort",ParamColor("ColorTrailShort",ColorRGB(255,0,0)),styleStaircase);
Plot(IIf(trailArray <
C,trailArray,Null),"\ntrailLong",ParamColor("ColorTrailLong",ColorRGB(0,255,0)),styleStaircase);
dojidiv =5;
CloseEqualOpen = ( High - Low ) / dojidiv > abs( Open - Close );
RefC = Ref( C, -1 );
RefO = Ref( O, -1 );
Up = C > O;
Down = C < O ;
UpDoji = CloseEqualOpen AND RefC > RefO;
DownDoji = CloseEqualOpen AND RefC < RefO;
colcond = IIf( up || updoji, colorBrightGreen, colorRed );
SetBarFillColor( colcond );
Plot( C, "Price", colcond, styleCandle );
/////////////////////////////////////////////////////
 

yasu222

Active Member
#70
Midas indicator

Plot( C, "Price " + Date(), colorBlack, styleCandle );
for( i = 1; i <= 5; i++ )
{
startdate = ParamDate("Starting Date " + i, "2000-01-01");
starttime = ParamTime("Starting Time " + i, "00:00:00" );
start = DateNum() < startdate AND TimeNum() <= starttime;
mp = (H+L)/2;
pv = Volume * mp;
denom = Cum( V ) - ValueWhen( start, Cum( V ) );
nom = Cum( pv ) - ValueWhen( start, Cum( pv ) );
midas = IIf( BarsSince( start ), nom/denom, Null );
Plot( midas, "Midas" + i, colorRed + i, styleLine | styleThick | styleNoRescale );

////////////////////////////////////////////////////////////////////////////////////////////////
THE MIDAS FORMULA
The particular VWAP formula used by Paul Levine was fully
discussed in George Reyna’s article. The mathematical detail
of the conceptual foundations we have just examined can be
expressed as the following equation:
MIDAS = i – y x i – dij
dij
i ij y x
where:
xi
=Cumulative volume on day
yi
= Cumulative price on day
dij = Cumulative volume difference between days i and j
= xi
- xj
This equation reads: (The cumulative price)(Volume at a
given instant) – (The cumulative price)(Volume at a period d
units of cumulative volume earlier), all divided by d, where
d is the cumulative volume displacement measured from the
launch point to the given instant.
 
Last edited:

Similar threads