The support forum is built with (1) General and FAQ forums for common trading queries received from aspiring and experienced traders, and (2) forums for course video topics. How to Trade Price Action and How to Trade Forex Price Action videos are consolidated into common forums.
Brooks Trading Course social media communities
I've been tinkering with the following code in Multicharts (powerlanguage), which should be close to compatible with tradestation.
What it does is plot pivot pointpoint highs/lows and draw a horisontal line, until it either forms a DB/DT or is broken through.
You can easily adapt it to your own purposes, but it is quite usefull out of the box. Works on any timeframe on S&P.
----------------------------- Code start - DoubleTops -------------------------------------
inputs: Price(H), LeftStrength(3), RightStrength(3), Offset(0.2); array: tl_id[](0), tl_value[](0); // Declaring arrat size, to hold dynamic number of tops array_setmaxindex(tl_id, value1+1); array_setmaxindex(tl_value, value1+1); // Using Pivot highs for starting possible tops if PivotHighVSBar(1, Price, LeftStrength, RightStrength, RightStrength+1) <> -1 then begin tl_new_bn(barnumber[3], H[3], barnumber, H[3]); tl_id[value1] = tl_getactive; tl_value[value1] = H[3]; end; // Running loop to see if trendlines from pivot highs are crossed for value1 = 0 to array_getmaxindex(tl_id) begin condition1 = H < tl_value[value1]+offset and H > tl_value[value1]-offset; if tl_id[value1] <> 0 and (condition1 or C > tl_value[value1]) then begin tl_setend_bn(tl_id[value1], barnumber, tl_value[value1]); tl_setcolor(tl_id[value1], green); tl_setstyle(tl_id[value1], tool_dotted); tl_id[value1] = 0; end else if tl_id[value1] <> 0 and C < tl_value[value1] then begin tl_setend_bn(tl_id[value1], barnumber, tl_value[value1]); tl_setcolor(tl_id[value1], green); tl_setstyle(tl_id[value1], tool_dotted); end; end; // Resetting array for next session if sessionlastbar then begin array_setmaxindex(tl_id, 0); array_setmaxindex(tl_value, 0); end;
----------------------------- Code start - Double Bottoms -------------------------------------
inputs: Price(L), LeftStrength(3), RightStrength(3), Offset(0.2); array: tl_id[](0), tl_value[](0); // Declaring arrat size, to hold dynamic number of tops array_setmaxindex(tl_id, value1+1); array_setmaxindex(tl_value, value1+1); // Using Pivot highs for starting possible tops if PivotLowVSBar( 1, Price, LeftStrength, RightStrength, RightStrength + 1 ) <> -1 then begin tl_new_bn(barnumber[3], L[3], barnumber, L[3]); tl_id[value1] = tl_getactive; tl_value[value1] = L[3]; end; // Running loop to see if trendlines from pivot highs are crossed for value1 = 0 to array_getmaxindex(tl_id) begin condition1 = L < tl_value[value1]+offset and L > tl_value[value1]-offset; if tl_id[value1] <> 0 and (condition1 or C < tl_value[value1]) then begin tl_setend_bn(tl_id[value1], barnumber, tl_value[value1]); tl_setcolor(tl_id[value1], red); tl_setstyle(tl_id[value1], tool_dotted); tl_id[value1] = 0; end else if tl_id[value1] <> 0 and C > tl_value[value1] then begin tl_setend_bn(tl_id[value1], barnumber, tl_value[value1]); tl_setcolor(tl_id[value1], red); tl_setstyle(tl_id[value1], tool_dotted); end; end; // Resetting array for next session if sessionlastbar then begin array_setmaxindex(tl_id, 0); array_setmaxindex(tl_value, 0); end;