NexusFi: Find Your Edge


Home Menu

 





ACD trading By Mark Fisher


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one mfbreakout with 195 posts (185 thanks)
    2. looks_two Fat Tails with 92 posts (260 thanks)
    3. looks_3 sysot1t with 21 posts (2 thanks)
    4. looks_4 forrestang with 20 posts (4 thanks)
      Best Posters
    1. looks_one silver99 with 4.7 thanks per post
    2. looks_two Fat Tails with 2.8 thanks per post
    3. looks_3 dandxg with 2 thanks per post
    4. looks_4 mfbreakout with 0.9 thanks per post
    1. trending_up 356,512 views
    2. thumb_up 598 thanks given
    3. group 119 followers
    1. forum 541 posts
    2. attach_file 163 attachments




 
Search this Thread

ACD trading By Mark Fisher

  #401 (permalink)
 
Lornz's Avatar
 Lornz 
Oslo, Norway
 
Experience: Advanced
Platform: CQG, Excel
Trading: CL
Posts: 1,193 since Apr 2010


rcabri View Post

Thanks, but it's missing one video.



Excellent! Thanks a lot!

Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #402 (permalink)
 dubstrading 
Auckland, New Zealand
 
Experience: Intermediate
Platform: Multiple
Trading: Futures
Posts: 8 since Nov 2011
Thanks Given: 14
Thanks Received: 5

Had been looking for the 3rd video since it wasn't uploaded to vimeo. Thanks!

Reply With Quote
  #403 (permalink)
 
daytrader4545's Avatar
 daytrader4545 
Boise Idaho usa
 
Experience: Advanced
Platform: Mirus futures
Broker: Iq feed
Trading: ES,CL,NG,GC
Posts: 13 since Jan 2011
Thanks Given: 198
Thanks Received: 21





I have been looking on the web for a while for the other videos like this list thank you so much for posting them !!!!

Reply With Quote
  #404 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

If these videos are public domain, it would be best to attach them directly to your post. Attachments can be up to 1GB each when zipped, and up to 256MB each for mp4 or flv videos. If video is WMV or AVI, zip it first.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #405 (permalink)
 
Bookworm's Avatar
 Bookworm 
Long Island, NY
 
Experience: Advanced
Platform: TOS
Broker: TD Ameritrade
Trading: Equities, index options and futures/futures options
Posts: 190 since Apr 2010
Thanks Given: 66
Thanks Received: 198

I wrote these indicators for eSignal back in 2006 to trade the ACD system. Feel free to translate to other languages:

/***
This formula will display the high/low lines of the opening range and
the A & C lines for the day based on the book "The Logical Trader".
***/

function preMain() {
setPriceStudy(true);
setStudyTitle("ACD System");
setCursorLabelName("30m H", 0);
setCursorLabelName("30m L", 1);
setCursorLabelName("C Up ", 2);
setCursorLabelName("A Up ", 3);
setCursorLabelName("A Down", 4);
setCursorLabelName("C Down", 5);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.blue, 1);
setDefaultBarFgColor(Color.green, 2);
setDefaultBarFgColor(Color.green, 3);
setDefaultBarFgColor(Color.red, 4);
setDefaultBarFgColor(Color.red, 5);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setDefaultBarThickness(1, 2);
setDefaultBarThickness(1, 3);
setDefaultBarThickness(1, 4);
setDefaultBarThickness(1, 5);
setPlotType(PLOTTYPE_FLATLINES, 0);
setPlotType(PLOTTYPE_FLATLINES, 1);
setPlotType(PLOTTYPE_FLATLINES, 2);
setPlotType(PLOTTYPE_FLATLINES, 3);
setPlotType(PLOTTYPE_FLATLINES, 4);
setPlotType(PLOTTYPE_FLATLINES, 5);

var fp1 = new FunctionParameter("nMin", FunctionParameter.NUMBER);
fp1.setName("Number of Minutes");
fp1.setLowerLimit(1);
fp1.setDefault(60);

var fp2 = new FunctionParameter("nThickness", FunctionParameter.NUMBER);
fp2.setName("Line Thickness");
fp2.setLowerLimit(1);
fp2.setDefault(1);

var fp3 = new FunctionParameter("cColorH", FunctionParameter.COLOR);
fp3.setName("High Color");
fp3.setDefault(Color.RGB(0,0,192));

var fp4 = new FunctionParameter("cColorL", FunctionParameter.COLOR);
fp4.setName("Low Color");
fp4.setDefault(Color.RGB(0,0,192));

var fp5 = new FunctionParameter("nTicksA", FunctionParameter.NUMBER);
fp5.setName("Ticks for A");
fp5.setLowerLimit(.01);
fp5.setDefault(1)

var fp6 = new FunctionParameter("nTicksC", FunctionParameter.NUMBER);
fp6.setName("Ticks for C");
fp6.setLowerLimit(.01);
fp6.setDefault(1)

var fp7 = new FunctionParameter("cColorCUp", FunctionParameter.COLOR);
fp7.setName("C Up Color");
fp7.setDefault(Color.RGB(0,133,0));

var fp8 = new FunctionParameter("cColorAUp", FunctionParameter.COLOR);
fp8.setName("A Up Color");
fp8.setDefault(Color.RGB(0,133,0));

var fp9 = new FunctionParameter("cColorADown", FunctionParameter.COLOR);
fp9.setName("A Down Color");
fp9.setDefault(Color.RGB(192,0,0));

var fp10 = new FunctionParameter("cColorCDown", FunctionParameter.COLOR);
fp10.setName("C Down Color");
fp10.setDefault(Color.RGB(192,0,0));
}

var bEdit = true;
var bActive = true;
var nDayCntr = 0;

var vStartTime = null;
var vHigh = null;
var vLow = null;
var FirstBar = null;

function main(nMin, nThickness, cColorH, cColorL, cColorCUp, cColorAUp, cColorADown, cColorCDown, nTicksA, nTicksC) {
if (nMin == null) nMin = 60;
if (bEdit == true) {
nMin = Math.round(nMin);
setCursorLabelName(nMin + "min H", 0);
setCursorLabelName(nMin + "min L", 1);
setDefaultBarThickness(nThickness, 0);
setDefaultBarThickness(nThickness, 0);
setDefaultBarFgColor(cColorH, 0);
setDefaultBarFgColor(cColorL, 1);
setDefaultBarFgColor(cColorCUp, 2);
setDefaultBarFgColor(cColorAUp, 3);
setDefaultBarFgColor(cColorADown, 4);
setDefaultBarFgColor(cColorCDown, 5);
bEdit = false;
}

if (getDay() != getDay(-1) || vHigh == null || vLow == null) {
bActive = true;
nDayCntr += 1;
vStartTime = getValue("Time");
vHigh = high();
vLow = low();
}
FirstBar = getFirstBarIndexOfDay(vStartTime);
var vTime = getValue("Time");

// 3,600,000 milliseconds = 1 hour
// 60,000 milliseconds = 1 minute
if ((vTime - vStartTime)/60000 < nMin) {
vHigh = Math.max(high(), vHigh);
vLow = Math.min(low(), vLow);
} else {
bActive = false;
}

if (FirstBar != null) {
drawLineRelative( FirstBar, vHigh, 1, vHigh, PS_DASHDOT, nThickness,cColorH, "Hline");
drawTextRelative( 2, vHigh, vHigh.toFixed(2), cColorH, null, Text.VCENTER|Text.BOLD, null, 11, "High");
drawLineRelative( FirstBar, vHigh+nTicksC, 1,vHigh+nTicksC, PS_DOT, nThickness, cColorCUp, "CUp");
drawTextRelative( 2, vHigh+nTicksC, (vHigh+nTicksC).toFixed(2), cColorCUp, null, Text.VCENTER|Text.BOLD, null, 11, "CUp");
drawLineRelative( FirstBar, vHigh+nTicksA, 1,vHigh+nTicksA, PS_DASH, nThickness, cColorAUp, "AUp");
drawTextRelative( 2, vHigh+nTicksA, (vHigh+nTicksA).toFixed(2), cColorAUp, null, Text.VCENTER|Text.BOLD, null, 11, "AUp");
drawLineRelative( FirstBar, vLow, 1, vLow, PS_DASHDOT, nThickness, cColorL, "Lline")
drawTextRelative( 2, vLow, vLow.toFixed(2), cColorL, null, Text.VCENTER|Text.BOLD, null, 11, "Low");
drawLineRelative( FirstBar, vLow-nTicksA, 1,vLow-nTicksA, PS_DASH, nThickness, cColorADown, "ADown");
drawTextRelative( 2, vLow-nTicksA, (vLow-nTicksA).toFixed(2), cColorADown, null, Text.VCENTER|Text.BOLD, null, 11, "ADown");
drawLineRelative( FirstBar, vLow-nTicksC, 1,vLow-nTicksC, PS_DOT, nThickness, cColorCDown, "CDown");
drawTextRelative( 2, vLow-nTicksC, (vLow-nTicksC).toFixed(2), cColorCDown, null, Text.VCENTER|Text.BOLD, null, 11, "CDown");
}

if (bActive == false) {
return new Array(vHigh.toFixed(2), vLow.toFixed(2),(vHigh+nTicksC).toFixed(2),(vHigh+nTicksA).toFixed(2),
(vLow-nTicksA).toFixed(2),(vLow-nTicksC).toFixed(2));
}
return null;
}


/****************************************************************************************************
This study generates the Pivot Range from the book "The Logical Trader"
****************************************************************************************************/


function preMain() {
setPriceStudy(true);
setStudyTitle("ACD Pivot Range");
setCursorLabelName("PR1", 0);
setCursorLabelName("PR2", 1);



// Pivot Range 1
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.RGB(40,40,40), 0);
setDefaultBarThickness(1, 0);

// Pivot Range 2
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.RGB(40,40,40), 1);
setDefaultBarThickness(1, 1);

}

// Start of Performance addition
var vLastRawTime = null;
var vLastPR1 = null;
var vLastPR2 = null;
var vLastArray = null;
var vSymbol = null;
var vInterval = null;
var vReset = true;

var vDisplayDate = null;
var bDisplay = false;

function main(nDays) {
if (vDisplayDate == null) {
if (nDays == null) nDays = 5;
var msPerDay = (24 * 60 * 60 * 1000);
vDisplayDate = new Date() *1;
vDisplayDate = vDisplayDate - ((nDays+2)*msPerDay);
vDisplayDate = new Date(vDisplayDate);
}
if (bDisplay == false && getDay(0) != getDay(-1)) {
var vDate = getValue("Time");
vDate = new Date(vDate);
if (vDate >= vDisplayDate) {
bDisplay = true;
}
}
if (bDisplay == false) return;


var vH;
var vL;
var vC;
var vRawTime;
var vBarTime;
var vIndex;

var nState = getBarState();
if(vReset == true) {
vLastRawTime = null;
vLastArray = null;
vLastPR1 = null;
vLastPR2 = null;
vInterval = getInterval();
vSymbol = getSymbol();
vSymbol += ",D";
vReset = false;
}

//vRawTime = getValue("rawtime"); // does not work properly with 1 min interval
vRawTime = getDay();
if(vRawTime == null)
return;

//vRawTime = Math.floor(vRawTime / RawTime.DAY);

// Start of Performance addition
if(vRawTime != null && vLastRawTime != null) {
if(vRawTime == vLastRawTime) {
return vLastArray;
// return new Array(vLastPR1, vLastPR2);



}
}

if(vInterval == null)
return null;

if(vInterval == "D")
return null;

if(vInterval == "W")
return null;

if(vInterval == "M")
return null;

if(vInterval == "T")
return null;

vBarTime = getValue("time");
if(vBarTime != null) {
var vDay = vBarTime.getDay();
if (vDay == 0) {
var vDate = vBarTime.getDate();
vDate -= 2;
vBarTime.setDate(vDate);
}
vAbsTime = getPreviousTradingDay(vBarTime, vSymbol);
if(vAbsTime == null) {
return;
}
vIndex = getFirstBarIndexOfDay(vAbsTime, vSymbol);
if(vIndex != null) {
vH = getValueAbsolute("High", vIndex, vSymbol);
vL = getValueAbsolute("Low", vIndex, vSymbol);
vC = getValueAbsolute("Close", vIndex, vSymbol);
if(vH != null && vL != null && vC != null) {
vLastPR1 = ((vH+vL+vC)/3)+(((vH+vL+ vC)/3)-((vH+vL)/2))
vLastPR2 = ((vH+vL+vC)/3)-(((vH+vL+ vC)/3)-((vH+vL)/2))
vLastRawTime = vRawTime;
vLastArray = new Array(vLastPR1, vLastPR2);

drawLineAbsolute(0,vLastPR1,1,vLastPR1,PS_SOLID,1,Color.RGB(40,40,40),10);
drawTextAbsolute( 9, vLastPR1, vLastPR1.toFixed(2), Color.RGB(40,40,40), null, Text.VCENTER|Text.BOLD, null, 11, "PR1");
drawLineAbsolute(0,vLastPR2,1,vLastPR2,PS_SOLID,1,Color.RGB(40,40,40),20);
drawTextAbsolute( 9, vLastPR2, vLastPR2.toFixed(2), Color.RGB(40,40,40), null, Text.VCENTER|Text.BOLD, null, 11, "PR2");

return vLastArray;


}
}
}
return null;
}


//{{EFSWizard_Description
//
// This formula generates the Pivot Moving Averages described in the book "The Logical Trader".
//
//}}EFSWizard_Description


//{{EFSWizard_Declarations
var vSMA14_of_HLC3 = new MAStudy(14, 1, "HLC/3", MAStudy.SIMPLE);
var vSMA30_of_HLC3 = new MAStudy(30, 1, "HLC/3", MAStudy.SIMPLE);
var vSMA50_of_HLC3 = new MAStudy(50, 1, "HLC/3", MAStudy.SIMPLE);
var vLastAlert = -1;
//}}EFSWizard_Declarations


function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(true);
setStudyTitle("ACD Pivot Moving Averages");
setCursorLabelName("14PMA", 0);
setCursorLabelName("30PMA", 1);
setCursorLabelName("50PMA", 2);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarStyle(PS_SOLID, 2);
setDefaultBarFgColor(Color.RGB(255,215,0), 0);
setDefaultBarFgColor(Color.RGB(0,0,255), 1);
setDefaultBarFgColor(Color.RGB(255,0,0), 2);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setDefaultBarThickness(1, 2);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
setPlotType(PLOTTYPE_LINE, 2);
//}}EFSWizard_PreMain

}

function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/

//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1

//}}EFSWizard_Expressions


//{{EFSWizard_Return
return new Array(
vSMA14_of_HLC3.getValue(MAStudy.MA),
vSMA30_of_HLC3.getValue(MAStudy.MA),
vSMA50_of_HLC3.getValue(MAStudy.MA)
);
//}}EFSWizard_Return

}

function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}

//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1

//}}EFSWizard_Actions

Reply With Quote
  #406 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

@Bookworm:

1) Does the code use the settlement price or the close for futures?
2) Does it calculate ETH or RTH pivots (I think that Mark Fisher originally used RTH, but then switched do ETH)
3) Does it include the A and C levels for trading breakouts?
4) Would you have a chart?

Thank you.

Reply With Quote
  #407 (permalink)
 hector24 
austin, texas
 
Experience: Intermediate
Platform: ninja trader
Trading: currency futures
Posts: 506 since Jan 2011
Thanks Given: 14
Thanks Received: 234


Fat Tails View Post
@Bookworm:

1) Does the code use the settlement price or the close for futures?
2) Does it calculate ETH or RTH pivots (I think that Mark Fisher originally used RTH, but then switched do ETH)
3) Does it include the A and C levels for trading breakouts?
4) Would you have a chart?

Thank you.

Fat Tails it would be great if you could translate this into Nijna. I have been waiting forever for this indicator. I am surprised no one else has requested for help with this indicator. Right now I currently draw it by hand and this would really save me some time. Hope it can be figured out.

Thanks
Hector

Reply With Quote
Thanked by:
  #408 (permalink)
 hector24 
austin, texas
 
Experience: Intermediate
Platform: ninja trader
Trading: currency futures
Posts: 506 since Jan 2011
Thanks Given: 14
Thanks Received: 234


Bookworm View Post
I wrote these indicators for eSignal back in 2006 to trade the ACD system. Feel free to translate to other languages:

/***
This formula will display the high/low lines of the opening range and
the A & C lines for the day based on the book "The Logical Trader".
***/

function preMain() {
setPriceStudy(true);
setStudyTitle("ACD System");
setCursorLabelName("30m H", 0);
setCursorLabelName("30m L", 1);
setCursorLabelName("C Up ", 2);
setCursorLabelName("A Up ", 3);
setCursorLabelName("A Down", 4);
setCursorLabelName("C Down", 5);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.blue, 1);
setDefaultBarFgColor(Color.green, 2);
setDefaultBarFgColor(Color.green, 3);
setDefaultBarFgColor(Color.red, 4);
setDefaultBarFgColor(Color.red, 5);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setDefaultBarThickness(1, 2);
setDefaultBarThickness(1, 3);
setDefaultBarThickness(1, 4);
setDefaultBarThickness(1, 5);
setPlotType(PLOTTYPE_FLATLINES, 0);
setPlotType(PLOTTYPE_FLATLINES, 1);
setPlotType(PLOTTYPE_FLATLINES, 2);
setPlotType(PLOTTYPE_FLATLINES, 3);
setPlotType(PLOTTYPE_FLATLINES, 4);
setPlotType(PLOTTYPE_FLATLINES, 5);

var fp1 = new FunctionParameter("nMin", FunctionParameter.NUMBER);
fp1.setName("Number of Minutes");
fp1.setLowerLimit(1);
fp1.setDefault(60);

var fp2 = new FunctionParameter("nThickness", FunctionParameter.NUMBER);
fp2.setName("Line Thickness");
fp2.setLowerLimit(1);
fp2.setDefault(1);

var fp3 = new FunctionParameter("cColorH", FunctionParameter.COLOR);
fp3.setName("High Color");
fp3.setDefault(Color.RGB(0,0,192));

var fp4 = new FunctionParameter("cColorL", FunctionParameter.COLOR);
fp4.setName("Low Color");
fp4.setDefault(Color.RGB(0,0,192));

var fp5 = new FunctionParameter("nTicksA", FunctionParameter.NUMBER);
fp5.setName("Ticks for A");
fp5.setLowerLimit(.01);
fp5.setDefault(1)

var fp6 = new FunctionParameter("nTicksC", FunctionParameter.NUMBER);
fp6.setName("Ticks for C");
fp6.setLowerLimit(.01);
fp6.setDefault(1)

var fp7 = new FunctionParameter("cColorCUp", FunctionParameter.COLOR);
fp7.setName("C Up Color");
fp7.setDefault(Color.RGB(0,133,0));

var fp8 = new FunctionParameter("cColorAUp", FunctionParameter.COLOR);
fp8.setName("A Up Color");
fp8.setDefault(Color.RGB(0,133,0));

var fp9 = new FunctionParameter("cColorADown", FunctionParameter.COLOR);
fp9.setName("A Down Color");
fp9.setDefault(Color.RGB(192,0,0));

var fp10 = new FunctionParameter("cColorCDown", FunctionParameter.COLOR);
fp10.setName("C Down Color");
fp10.setDefault(Color.RGB(192,0,0));
}

var bEdit = true;
var bActive = true;
var nDayCntr = 0;

var vStartTime = null;
var vHigh = null;
var vLow = null;
var FirstBar = null;

function main(nMin, nThickness, cColorH, cColorL, cColorCUp, cColorAUp, cColorADown, cColorCDown, nTicksA, nTicksC) {
if (nMin == null) nMin = 60;
if (bEdit == true) {
nMin = Math.round(nMin);
setCursorLabelName(nMin + "min H", 0);
setCursorLabelName(nMin + "min L", 1);
setDefaultBarThickness(nThickness, 0);
setDefaultBarThickness(nThickness, 0);
setDefaultBarFgColor(cColorH, 0);
setDefaultBarFgColor(cColorL, 1);
setDefaultBarFgColor(cColorCUp, 2);
setDefaultBarFgColor(cColorAUp, 3);
setDefaultBarFgColor(cColorADown, 4);
setDefaultBarFgColor(cColorCDown, 5);
bEdit = false;
}

if (getDay() != getDay(-1) || vHigh == null || vLow == null) {
bActive = true;
nDayCntr += 1;
vStartTime = getValue("Time");
vHigh = high();
vLow = low();
}
FirstBar = getFirstBarIndexOfDay(vStartTime);
var vTime = getValue("Time");

// 3,600,000 milliseconds = 1 hour
// 60,000 milliseconds = 1 minute
if ((vTime - vStartTime)/60000 < nMin) {
vHigh = Math.max(high(), vHigh);
vLow = Math.min(low(), vLow);
} else {
bActive = false;
}

if (FirstBar != null) {
drawLineRelative( FirstBar, vHigh, 1, vHigh, PS_DASHDOT, nThickness,cColorH, "Hline");
drawTextRelative( 2, vHigh, vHigh.toFixed(2), cColorH, null, Text.VCENTER|Text.BOLD, null, 11, "High");
drawLineRelative( FirstBar, vHigh+nTicksC, 1,vHigh+nTicksC, PS_DOT, nThickness, cColorCUp, "CUp");
drawTextRelative( 2, vHigh+nTicksC, (vHigh+nTicksC).toFixed(2), cColorCUp, null, Text.VCENTER|Text.BOLD, null, 11, "CUp");
drawLineRelative( FirstBar, vHigh+nTicksA, 1,vHigh+nTicksA, PS_DASH, nThickness, cColorAUp, "AUp");
drawTextRelative( 2, vHigh+nTicksA, (vHigh+nTicksA).toFixed(2), cColorAUp, null, Text.VCENTER|Text.BOLD, null, 11, "AUp");
drawLineRelative( FirstBar, vLow, 1, vLow, PS_DASHDOT, nThickness, cColorL, "Lline")
drawTextRelative( 2, vLow, vLow.toFixed(2), cColorL, null, Text.VCENTER|Text.BOLD, null, 11, "Low");
drawLineRelative( FirstBar, vLow-nTicksA, 1,vLow-nTicksA, PS_DASH, nThickness, cColorADown, "ADown");
drawTextRelative( 2, vLow-nTicksA, (vLow-nTicksA).toFixed(2), cColorADown, null, Text.VCENTER|Text.BOLD, null, 11, "ADown");
drawLineRelative( FirstBar, vLow-nTicksC, 1,vLow-nTicksC, PS_DOT, nThickness, cColorCDown, "CDown");
drawTextRelative( 2, vLow-nTicksC, (vLow-nTicksC).toFixed(2), cColorCDown, null, Text.VCENTER|Text.BOLD, null, 11, "CDown");
}

if (bActive == false) {
return new Array(vHigh.toFixed(2), vLow.toFixed(2),(vHigh+nTicksC).toFixed(2),(vHigh+nTicksA).toFixed(2),
(vLow-nTicksA).toFixed(2),(vLow-nTicksC).toFixed(2));
}
return null;
}


/****************************************************************************************************
This study generates the Pivot Range from the book "The Logical Trader"
****************************************************************************************************/


function preMain() {
setPriceStudy(true);
setStudyTitle("ACD Pivot Range");
setCursorLabelName("PR1", 0);
setCursorLabelName("PR2", 1);



// Pivot Range 1
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.RGB(40,40,40), 0);
setDefaultBarThickness(1, 0);

// Pivot Range 2
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.RGB(40,40,40), 1);
setDefaultBarThickness(1, 1);

}

// Start of Performance addition
var vLastRawTime = null;
var vLastPR1 = null;
var vLastPR2 = null;
var vLastArray = null;
var vSymbol = null;
var vInterval = null;
var vReset = true;

var vDisplayDate = null;
var bDisplay = false;

function main(nDays) {
if (vDisplayDate == null) {
if (nDays == null) nDays = 5;
var msPerDay = (24 * 60 * 60 * 1000);
vDisplayDate = new Date() *1;
vDisplayDate = vDisplayDate - ((nDays+2)*msPerDay);
vDisplayDate = new Date(vDisplayDate);
}
if (bDisplay == false && getDay(0) != getDay(-1)) {
var vDate = getValue("Time");
vDate = new Date(vDate);
if (vDate >= vDisplayDate) {
bDisplay = true;
}
}
if (bDisplay == false) return;


var vH;
var vL;
var vC;
var vRawTime;
var vBarTime;
var vIndex;

var nState = getBarState();
if(vReset == true) {
vLastRawTime = null;
vLastArray = null;
vLastPR1 = null;
vLastPR2 = null;
vInterval = getInterval();
vSymbol = getSymbol();
vSymbol += ",D";
vReset = false;
}

//vRawTime = getValue("rawtime"); // does not work properly with 1 min interval
vRawTime = getDay();
if(vRawTime == null)
return;

//vRawTime = Math.floor(vRawTime / RawTime.DAY);

// Start of Performance addition
if(vRawTime != null && vLastRawTime != null) {
if(vRawTime == vLastRawTime) {
return vLastArray;
// return new Array(vLastPR1, vLastPR2);



}
}

if(vInterval == null)
return null;

if(vInterval == "D")
return null;

if(vInterval == "W")
return null;

if(vInterval == "M")
return null;

if(vInterval == "T")
return null;

vBarTime = getValue("time");
if(vBarTime != null) {
var vDay = vBarTime.getDay();
if (vDay == 0) {
var vDate = vBarTime.getDate();
vDate -= 2;
vBarTime.setDate(vDate);
}
vAbsTime = getPreviousTradingDay(vBarTime, vSymbol);
if(vAbsTime == null) {
return;
}
vIndex = getFirstBarIndexOfDay(vAbsTime, vSymbol);
if(vIndex != null) {
vH = getValueAbsolute("High", vIndex, vSymbol);
vL = getValueAbsolute("Low", vIndex, vSymbol);
vC = getValueAbsolute("Close", vIndex, vSymbol);
if(vH != null && vL != null && vC != null) {
vLastPR1 = ((vH+vL+vC)/3)+(((vH+vL+ vC)/3)-((vH+vL)/2))
vLastPR2 = ((vH+vL+vC)/3)-(((vH+vL+ vC)/3)-((vH+vL)/2))
vLastRawTime = vRawTime;
vLastArray = new Array(vLastPR1, vLastPR2);

drawLineAbsolute(0,vLastPR1,1,vLastPR1,PS_SOLID,1,Color.RGB(40,40,40),10);
drawTextAbsolute( 9, vLastPR1, vLastPR1.toFixed(2), Color.RGB(40,40,40), null, Text.VCENTER|Text.BOLD, null, 11, "PR1");
drawLineAbsolute(0,vLastPR2,1,vLastPR2,PS_SOLID,1,Color.RGB(40,40,40),20);
drawTextAbsolute( 9, vLastPR2, vLastPR2.toFixed(2), Color.RGB(40,40,40), null, Text.VCENTER|Text.BOLD, null, 11, "PR2");

return vLastArray;


}
}
}
return null;
}


//{{EFSWizard_Description
//
// This formula generates the Pivot Moving Averages described in the book "The Logical Trader".
//
//}}EFSWizard_Description


//{{EFSWizard_Declarations
var vSMA14_of_HLC3 = new MAStudy(14, 1, "HLC/3", MAStudy.SIMPLE);
var vSMA30_of_HLC3 = new MAStudy(30, 1, "HLC/3", MAStudy.SIMPLE);
var vSMA50_of_HLC3 = new MAStudy(50, 1, "HLC/3", MAStudy.SIMPLE);
var vLastAlert = -1;
//}}EFSWizard_Declarations


function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(true);
setStudyTitle("ACD Pivot Moving Averages");
setCursorLabelName("14PMA", 0);
setCursorLabelName("30PMA", 1);
setCursorLabelName("50PMA", 2);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarStyle(PS_SOLID, 2);
setDefaultBarFgColor(Color.RGB(255,215,0), 0);
setDefaultBarFgColor(Color.RGB(0,0,255), 1);
setDefaultBarFgColor(Color.RGB(255,0,0), 2);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setDefaultBarThickness(1, 2);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
setPlotType(PLOTTYPE_LINE, 2);
//}}EFSWizard_PreMain

}

function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/

//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1

//}}EFSWizard_Expressions


//{{EFSWizard_Return
return new Array(
vSMA14_of_HLC3.getValue(MAStudy.MA),
vSMA30_of_HLC3.getValue(MAStudy.MA),
vSMA50_of_HLC3.getValue(MAStudy.MA)
);
//}}EFSWizard_Return

}

function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}

//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1

//}}EFSWizard_Actions

Thanks Book Worm, hopefully it can be translated into Ninja. Once again thanks.

Hector

Reply With Quote
Thanked by:
  #409 (permalink)
 
Bookworm's Avatar
 Bookworm 
Long Island, NY
 
Experience: Advanced
Platform: TOS
Broker: TD Ameritrade
Trading: Equities, index options and futures/futures options
Posts: 190 since Apr 2010
Thanks Given: 66
Thanks Received: 198


Fat Tails View Post
@Bookworm:

1) Does the code use the settlement price or the close for futures?
2) Does it calculate ETH or RTH pivots (I think that Mark Fisher originally used RTH, but then switched do ETH)
3) Does it include the A and C levels for trading breakouts?
4) Would you have a chart?

Thank you.

I stopped using eSignal years ago and just found these indicators on an old disk stored away so no charts. To be honest, by now this is like high school Spanish, a vague memory. At the time I was trading NEM, the gold stock, using NYSE hours. For stocks, unlike commodities, the A & C values are the same but it's been so long I don't remember how this indicator shows them. If nothing else it should give someone with better coding skills than me a decent head start on updating them. Good luck!

Reply With Quote
  #410 (permalink)
 
lemons's Avatar
 lemons 
Tallinn, Estonia
 
Experience: Beginner
Platform: SC
Trading: NAS100
Posts: 959 since Nov 2010


@Fat Tails

Time template : Equity RTH East Coast

Reply With Quote




Last Updated on December 18, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts