VSA

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Re: VSA

Postby Apprentice » Wed Sep 23, 2015 5:11 am

Your request is additional to development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: VSA

Postby Stance » Thu Sep 24, 2015 6:05 pm

spotdespot wrote:Hi Apprentice - useful indicators thanks.

Is there any possibility of having the option to use True Volume for these please? Or produce real volume versions if not?

Many thanks,
Dave.


Hi Dave,

Here's my attempt to modify the indicator to use real volume.

Code: Select all
--+------------------------------------------------------------------+
--|                                   VSA No Demand No Supply.lua    |
--|                               Copyright © 2015, Gehtsoft USA LLC |
--|                                            http://fxcodebase.com |
--+------------------------------------------------------------------+
--|                                      Developed by : Mario Jemic  |                   
--|                                          mario.jemic@gmail.com   |
--+------------------------------------------------------------------+
--|                                 Support our efforts by donating  |
--|                                    Paypal: http://goo.gl/cEP5h5  |
--|                    BitCoin : 1MfUHS3h86MBTeonJzWdszdzF2iuKESCKU  | 
--+------------------------------------------------------------------+

-- Indicator profile initialization routine
-- Defines indicator profile properties and indicator parameters
-- TODO: Add minimal and maximal value of numeric parameters and default color of the streams
function Init()
    indicator:name("VSA No Demand No Supply with Real Volume");
    indicator:description("");
    indicator:requiredSource(core.Bar);
    indicator:type(core.Indicator);

    indicator.parameters:addInteger("NumberofTicks", "Number of Ticks", "Number of Ticks", 0);
   
   indicator.parameters:addInteger("Size", "Label Size", "", 10, 1 , 100);
    indicator.parameters:addColor("NSLabelColor", "Color of NoSupply", "Color of Label", core.rgb(0, 255, 0));
   indicator.parameters:addColor("NDLabelColor", "Color of NoDemand", "Color of Label", core.rgb(255,0 , 0));
end

-- Indicator instance initialization routine
-- Processes indicator parameters and creates output streams
-- TODO: Refine the first period calculation for each of the output streams.
-- TODO: Calculate all constants, create instances all subsequent indicators and load all required libraries
-- Parameters block
local NumberofTicks;

local first;
local source = nil;
local Size, NSLabelColor, NDLabelColor, font;
-- Streams block

 local O,L,H,C,Vol;
local FirstStart;
local LastTime;
 
 function ReleaseInstance()
       core.host:execute("deleteFont", font);
end      


-- Routine
function Prepare(nameOnly)
    NumberofTicks = instance.parameters.NumberofTicks;
    source = instance.source;
    first = source:first()+5;
   Size = instance.parameters.Size;
   NSLabelColor = instance.parameters.NSLabelColor;
   NDLabelColor = instance.parameters.NDLabelColor;
   
   font = core.host:execute("createFont", "Wingdings", Size, false, false);
 
   HT = instance:addInternalStream(first, 0);
   LT = instance:addInternalStream(first, 0);
   H=source.high;
    L=source.low;
   O=source.open;
   C=source.close;
   Vol=core.indicators:create("REAL VOLUME", source);
   
   FirstStart=true;
     LastTime=0;
   

    local name = profile:id() .. "(" .. source:name() .. ", " .. tostring(NumberofTicks) .. ")";
    instance:name(name);
 
end

 function Plot(Data, period, Label)
    if Data[period]== LT[period] then
    core.host:execute("drawLabel1", source:serial(period), source:date(period),  core.CR_CHART, Data[period], core.CR_CHART, core.H_Center, core.V_Top, font, NDLabelColor,  "\108");
    else
    core.host:execute("drawLabel1", source:serial(period), source:date(period),  core.CR_CHART, Data[period], core.CR_CHART, core.H_Center, core.V_Bottom, font, NSLabelColor,  "\108");
    end
 end;

   

-- Indicator calculation routine
-- TODO: Add your code for calculation output values
function Update(period, mode)
    if period < first or not source:hasData(period) then
   return;
   end
   Vol:update(mode);
    if not(Vol.DATA:hasData(period)) then
            if period==first then
                FirstStart=true;
            end   
            return;
        elseif FirstStart then
            FirstStart=false;
            instance:updateFrom(first);   
        elseif LastTime~=source:date(period) and period==source:size()-1 then
            LastTime=source:date(period);
            instance:updateFrom(period-10);
        end
   
   HT[period]=L[period] - NumberofTicks*source:pipSize();
    LT[period]=H[period] + NumberofTicks*source:pipSize();
   
   
   
if H[period]>H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==H[period] and C[period]>C[period-1] and Vol.DATA[period]<Vol.DATA[period-1]and Vol.DATA[period]<Vol.DATA[period-2] then 
   Plot(LT,period,"NoDemand");   
end;


if L[period]<L[period-1] and H[period]<=H[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==L[period] and C[period]<C[period-1] and Vol.DATA[period]<Vol.DATA[period-1]and Vol.DATA[period]<Vol.DATA[period-2] then 
   Plot(HT,period,"NoSupply");   
end;


if H[period]>H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==(((H[period]-L[period])*0.5)+L[period]) and C[period]>C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]   then 
   Plot(LT,period,"NoDemand");
end;


if L[period]<L[period-1] and H[period]<=H[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==(((H[period]-L[period])*0.5)+L[period]) and C[period]<C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]  then 
   Plot(HT,period,"NoSupply");
end;



if H[period]>H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==L[period] and C[period]>C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]   then 
   Plot(LT,period,"NoDemand");
end;

if L[period]<L[period-1] and H[period]<=H[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==H[period] and C[period]<C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]  then 
   Plot(HT,period,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


 

if H[period-2]>H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if L[period-2]<L[period-3] and H[period-2]<=H[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4]   then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]>H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==H[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then   
   Plot(LT,period-2,"NoDemand");
end;

if L[period-2]<L[period-3] and H[period-2]<=H[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==L[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]>H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if L[period-2]<L[period-3] and H[period-2]<=H[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]>H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==L[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if L[period-2]<L[period-3] and H[period-2]<=H[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==H[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-3]>H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==H[period-3] and C[period-3]>C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]>C[period] and H[period-3]>=H[period-2] and H[period-3]>=H[period-1] and H[period-3]>=H[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5] then 
   Plot(LT,period-3,"NoDemand");
end;

if L[period-3]<L[period-4] and H[period-3]<=H[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==L[period-3] and C[period-3]<C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]<C[period] and L[period-3]<=L[period-2] and L[period-3]<=L[period-1] and L[period-3]<=L[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(HT,period-3,"NoSupply");
end;


if H[period-3]>H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==((H[period-3]-L[period-3])*0.5)+L[period-3] and C[period-3]>C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]>C[period] and H[period-3]>=H[period-2] and H[period-3]>=H[period-1] and H[period-3]>=H[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(LT,period-3,"NoDemand");
end;

if L[period-3]<L[period-4] and H[period-3]<=H[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==((H[period-3]-L[period-3])*0.5)+L[period-3] and C[period-3]<C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]<C[period] and L[period-3]<=L[period-2] and L[period-3]<=L[period-1] and L[period-3]<=L[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(HT,period-3,"NoSupply");
end;


if H[period-3]>H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-3]-L[period-3]) and C[period-3]==O[period-3] and C[period-3]==L[period-3] and C[period-3]>C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]>C[period] and H[period-3]>=H[period-2] and H[period-3]>=H[period-1] and H[period-3]>=H[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5] then 
   Plot(LT,period-3,"NoDemand");
end;

if L[period-3]<L[period-4] and H[period-3]<=H[period-4] and (H[period-3]-L[period-3])<(H[period-3]-L[period-3]) and C[period-3]==O[period-3] and C[period-3]==H[period-3] and C[period-3]<C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]<C[period] and L[period-3]<=L[period-2] and L[period-3]<=L[period-1] and L[period-3]<=L[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]   then 
   Plot(HT,period-3,"NoSupply");
end;


if H[period]<=H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==H[period] and C[period]>C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2] then 
   Plot(LT,period,"NoDemand");
end;

if H[period]<=H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==L[period] and C[period]<C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2] then 
   Plot(HT,period,"NoSupply");
end;


if H[period]<=H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==((H[period]-L[period])*0.5)+L[period] and C[period]>C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]  then 
   Plot(LT,period,"NoDemand");
end;

if H[period]<=H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==((H[period]-L[period])*0.5)+L[period] and C[period]<C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2] then 
   Plot(HT,period,"NoSupply");
end;


if H[period]<=H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==L[period] and C[period]>C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]   then 
   Plot(LT,period,"NoDemand");
end;

if H[period]<=H[period-1] and L[period]>=L[period-1] and (H[period]-L[period])<(H[period-1]-L[period-1]) and C[period]==O[period] and C[period]==H[period] and C[period]<C[period-1] and Vol.DATA[period]<Vol.DATA[period-1] and Vol.DATA[period]<Vol.DATA[period-2]  then 
   Plot(HT,period,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4]  then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4]  then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==H[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==L[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==L[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]~=O[period-2] and C[period-2]==H[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-3]<=H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==H[period-3] and C[period-3]>C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]>C[period] and H[period-3]>=H[period-2] and H[period-3]>=H[period-1] and H[period-3]>=H[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(LT,period-3,"NoDemand");
end;

if H[period-3]<=H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==L[period-3] and C[period-3]<C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]<C[period] and L[period-3]<=L[period-2] and L[period-3]<=L[period-1] and L[period-3]<=L[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]   then 
   Plot(HT,period-3,"NoSupply");
end;


if H[period-3]<=H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==((H[period-3]-L[period-3])*0.5)+L[period-3] and C[period-3]>C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]>C[period] and H[period-3]>=H[period-2] and H[period-3]>=H[period-1] and H[period-3]>=H[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(LT,period-3,"NoDemand");
end;

if H[period-3]<=H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==((H[period-3]-L[period-3])*0.5)+L[period-3] and C[period-3]<C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]<C[period] and L[period-3]<=L[period-2] and L[period-3]<=L[period-1] and L[period-3]<=L[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(HT,period-3,"NoSupply");
end;


if H[period-3]<=H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==L[period-3] and C[period-3]>C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]>C[period] and H[period-3]>=H[period-2] and H[period-3]>=H[period-1] and H[period-3]>=H[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]  then 
   Plot(LT,period-3,"NoDemand");
end;

if H[period-3]<=H[period-4] and L[period-3]>=L[period-4] and (H[period-3]-L[period-3])<(H[period-4]-L[period-4]) and C[period-3]==O[period-3] and C[period-3]==H[period-3] and C[period-3]<C[period-4] and C[period-3]==C[period-2] and C[period-3]==C[period-1] and C[period-3]<C[period] and L[period-3]<=L[period-2] and L[period-3]<=L[period-1] and L[period-3]<=L[period] and Vol.DATA[period-3]<Vol.DATA[period-4] and Vol.DATA[period-3]<Vol.DATA[period-5]   then 
   Plot(HT,period-3,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])==(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==H[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])==(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==L[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])==(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]>C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4]   then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])==(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]<C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4]  then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1] ~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]==C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] and C[period-3]>C[period-4] then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==((H[period-2]-L[period-2])*0.5)+L[period-2] and C[period-2]==C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] and C[period-3]<C[period-4] then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==L[period-2] and C[period-2]==C[period-3] and C[period-2]==C[period-1] and C[period-2]>C[period] and H[period-2]>=H[period-1] and H[period-2]>=H[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] and C[period-3]>C[period-4]   then 
   Plot(LT,period-2,"NoDemand");
end;

if H[period-2]<=H[period-3] and L[period-2]>=L[period-3] and (H[period-2]-L[period-2])<(H[period-3]-L[period-3]) and C[period-2]==O[period-2] and C[period-2]==H[period-2] and C[period-2]==C[period-3] and C[period-2]==C[period-1] and C[period-2]<C[period] and L[period-2]<=L[period-1] and L[period-2]<=L[period] and Vol.DATA[period-2]<Vol.DATA[period-3] and Vol.DATA[period-2]<Vol.DATA[period-4] and C[period-3]<C[period-4]  then 
   Plot(HT,period-2,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==H[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==L[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3]  then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3]   then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==L[period-1] and C[period-1]==C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]>C[period-3]   then 
   Plot(LT,period-1,"NoDemand");
end;

if H[period-1]<=H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])==(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]==H[period-1] and C[period-1]==C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]<Vol.DATA[period-3] and C[period-2]<C[period-3]   then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

 

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;

if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then   
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]==Vol.DATA[period-2] and Vol.DATA[period-1]<=Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]==O[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==((H[period-1]-L[period-1])*0.5)+L[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;


if H[period-1]>H[period-2] and L[period-1]>=L[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==L[period-1] and C[period-1]>C[period-2] and C[period-1]>C[period] and H[period-1]>=H[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then
   Plot(LT,period-1,"NoDemand");
end;

if L[period-1]<L[period-2] and H[period-1]<=H[period-2] and (H[period-1]-L[period-1])<(H[period-2]-L[period-2]) and C[period-1]~=O[period-1] and C[period-1]==H[period-1] and C[period-1]<C[period-2] and C[period-1]<C[period] and L[period-1]<=L[period] and Vol.DATA[period-1]<Vol.DATA[period-2] and Vol.DATA[period-1]==Vol.DATA[period-3] then 
   Plot(HT,period-1,"NoSupply");
end;
 
   
end

Stance
FXCodeBase: Initiate
 
Posts: 141
Joined: Mon Jun 01, 2015 4:34 pm

Re: VSA

Postby spotdespot » Fri Sep 25, 2015 6:25 am

Thank you very much it look perfect!

There is one issue I am seeing with the original - I will check your real volume version and see if it exists there too - to do with refreshing I think.

Thanks again.

Cheers,
Dave.
spotdespot
 
Posts: 3
Joined: Tue Sep 22, 2015 9:12 am

Re: VSA

Postby spotdespot » Thu Oct 01, 2015 5:09 am

There is a bit of an issue with the No Supply/Demand indies and I "think" I have worked out when it is happening. Essentially when the chart with the indi on has focus it is fine. When it loses focus (focus either on another chart or another app) it prints dots all over and you have to manually go in to the indicator's properties to "reset" it.

fwiw - this happens in the original tick volume version and the real volume version.

See below for a before and after reset example after the chart has lost focus (overnight in this case).

Any chance this can be rectified?

Thanks,
Dave.
Attachments
Before_refresh_SupDem.png
After_Refresh_supdem.png
spotdespot
 
Posts: 3
Joined: Tue Sep 22, 2015 9:12 am


Re: VSA

Postby kingman » Fri Oct 09, 2015 11:38 am

im not getting any sound alert, is it possible get VSA strategie? plz i need a sound to work with
kingman
 
Posts: 2
Joined: Sat Sep 26, 2015 4:19 am

Re: VSA

Postby Steve0001 » Fri Oct 09, 2015 1:08 pm

I think this indicator has a lot of potential. Thank you for your hard work. It still has a small problem however. Mainly what I observe is this: While running live on a chart, it draws many signal dots that get removed if you make it redraw the exact same chart (e.g. make it change time frames and then back again). It seems that the ones that get removed are false signals (maybe they were tentative signals left over from a candle that didn't close as expected?), and they should have been removed without requiring the trader to manually redraw the chart. Thanks.

It is nowhere explained what "volume" data is being used in the analysis. I have to assume that it is tick volume, as this indicator works on pairs for which FXCM's "real volume" is not available. It would just be nice to know what "volume" data is being used. Thanks again for all the hard work.
Steve0001
 
Posts: 33
Joined: Sun Feb 26, 2012 7:52 pm

Re: VSA

Postby chimpy » Sat Oct 10, 2015 12:59 pm

Guys,
Can I draw your attention to this thread I started in 2011.
There is a zip file containing an MQ4 port of the whole suite of R.Wyckoff/Tom Williams VSA indicators, Five in total.
The hard work has already been done and the mq4 files only need porting over to LUA. There is even a pdf explaining it all, link in the original thread.

viewtopic.php?f=27&t=5424

I think Alexander.Gettinger ported over one of them but I have not tested it pending the other four.It saves you replicating effort. I am currently running MT4 especially for these VSA indicators and would love to use them in trading station.
chimpy
FXCodeBase: Initiate
 
Posts: 112
Joined: Fri Jun 10, 2011 10:32 am

Re: VSA

Postby Steve0001 » Mon Oct 12, 2015 10:03 pm

Hi Chimpy,

I think the other thread you started back in 2011 (in which you posted a zip file containing an "amazing mq4 VSA Volume Spread Analysis suite") might generate more interest if you were able to describe in a little more detail what those 5 or 6 indicators do (maybe post some screen shots?). I would like to genuinely say I am more than a little interested, but I don't have MT4 installed so anything I might say in favor of those indicators would be a guess.

There may also be more interest now that FXCM has made volume more readily available.
Steve0001
 
Posts: 33
Joined: Sun Feb 26, 2012 7:52 pm

Re: VSA

Postby Steve0001 » Mon Oct 12, 2015 10:18 pm

Hi Chimpy,

I think the other thread you started back in 2011 (in which you posted a zip file containing an "amazing mq4 VSA Volume Spread Analysis suite") might generate more interest if you were able to describe in a little more detail what those 5 or 6 indicators do (maybe post some screen shots?). I would like to genuinely say I am more than a little interested, but I don't have MT4 installed so anything I might say in favor of those indicators would be a guess.

There may also be more interest now that FXCM has made volume more readily available.
Steve0001
 
Posts: 33
Joined: Sun Feb 26, 2012 7:52 pm

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 69 guests