cleanup ...

This commit is contained in:
2024-05-28 08:01:50 +03:30
parent 030e8e3c72
commit 670ca1eac2
13 changed files with 5533 additions and 97395 deletions
File diff suppressed because it is too large Load Diff
+23 -41
View File
@@ -721,9 +721,11 @@ public:
// //
// TODO: // TODO:
// Make them Configurable ... // Make them Configurable ...
int maxTrailTPs = 5;
int levelsOnClose = 6; int levelsOnClose = 6;
int riskFreeLevel = 2;
int requiredAgeForTrail = 0; int requiredAgeForTrail = 0;
int requiredDistanceForTrail = 30; int requiredDistanceForTrail = 20;
// //
int positionsCount = ArraySize(positions); int positionsCount = ArraySize(positions);
@@ -792,7 +794,7 @@ public:
// //
double slDiff = PointToPrice(priceDistance, iPosition.symbol); double slDiff = PointToPrice(priceDistance, iPosition.symbol);
double appliedSL = slDiff / 2; double appliedSL = slDiff;
// //
double sl = double sl =
@@ -848,33 +850,8 @@ public:
// //
double priceDistanceInPoint = PriceToPoint((iPosition.profit - trail.profit) / iPosition.volume, iPosition.symbol); double priceDistanceInPoint = PriceToPoint((iPosition.profit - trail.profit) / iPosition.volume, iPosition.symbol);
double priceDistance = PointToPrice(priceDistanceInPoint, iPosition.symbol); double priceDistance = PointToPrice(priceDistanceInPoint, iPosition.symbol);
if (priceDistance < (requiredDistanceForTrail / 2)) if (priceDistance < requiredDistanceForTrail)
{ {
// //
// // int positionAge = iPosition.GetAge(iPosition.period);
// if (trail.level >= levelsOnClose)
// {
// //
// string comment = "EQM Close In Profit ...";
// bool isClosed = mTrader.ClosePositionPack(
// iPosition.ticket,
// iPosition.symbol,
// iPosition.period,
// comment,
// true,
// GetMinProfitPerTrade(),
// GetMinProfitPerVolumeFactor() //
// );
// if (isClosed)
// {
// //
// RemoveTrail(iPosition.ticket);
// //
// string message = "EQM Close (" + ToString(iPosition.ticket) + ") In Profit ...";
// mAlert.Alert(message);
// }
// }
continue; continue;
} }
@@ -883,21 +860,20 @@ public:
// //
double slDiff = PointToPrice(priceDistance, iPosition.symbol); double slDiff = PointToPrice(priceDistance, iPosition.symbol);
double appliedSL = slDiff / 2; double appliedSL = (slDiff / 2);
// //
double selectedValue = iPosition.sl; double selectedValue =
//
// // (riskFreeLevel > 0 &&
// double selectedValue = trail.level == riskFreeLevel) ||
// // (isLong
// trail.level == 1 || (isLong ? iPosition.sl < iPosition.entry
// ? iPosition.sl < iPosition.entry : iPosition.sl > iPosition.entry)
// : iPosition.sl > iPosition.entry) ? iPosition.entry
// ? iPosition.entry : iPosition.sl
// : iPosition.sl //
// // ;
// ;
// //
double sl = double sl =
@@ -1009,6 +985,12 @@ public:
// //
// Update Exists ... // Update Exists ...
//
if (trail.level >= maxTrailTPs)
{
continue;
}
// //
// Check Profit ... // Check Profit ...
bool isProfitPassed = MathAbs(iPosition.profit) > MathAbs(trail.profit); bool isProfitPassed = MathAbs(iPosition.profit) > MathAbs(trail.profit);
File diff suppressed because it is too large Load Diff
-308
View File
@@ -1,308 +0,0 @@
///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Class Library
// ----------------------------------------------
// Name: XSCX5EA
// Description: provides all X5 EA requirements ...
// - X5 Provider;
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property library
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://www.saherelm.ir"
#property version "1.00"
#property strict
//
// Imports ...
#include "../Classes/x-saherelm.xea.class.mq5"
#include "../Classes/x-saherelm.x5.provider.class.mq5"
//
// Define On Signal Event Handler Type Specified for X5 ...
typedef void (*TX5OnSignal)(X5ProviderDescriptor &descriptor);
//
// Class Definition ...
class XSCX5EA : public XSCBaseEA
{
//
// Public ...
public:
//
// Props ...
//
// Constructors ...
XSCX5EA(
//
// XTrade Class Requirements ...
int slippage, // Specify Slippage
ulong magicNumber, // Specify Magic Number
int manageInterval, // Manager Check Intervals Seconds
double maxAllowedSpread, // Max Allowed Spred for Opening Trades
int maxAllowedPositions, // Max Allowed Positions
double maxAllowedDrawdownFactor, // Max Allowed Drawdown Factor
double staticVolume, // Static Volume for Positions
//
// Position Management ...
bool allowLong = true, // Allow Long Trades
bool allowShort = true, // Allow Short Trades
double minProfitPerTrade = 0, // Min Profit Per Trade based On Volume Factor (Hedge)
double minProfitPerVolumeFactor = 0, // Min Volume Factor for Calculating Profit (Hedge)
//
// Event Handlers ...
TOnStopLoss onStopLossTriggered = NULL, // On StopLoass Triggered Event Handler
TOnTakeProfit onTakeProfitTriggered = NULL, // On TakeProfit Triggered Event Handler
TOnDealsChanged onDealsChangedHandler = NULL, // On Deals Changed Event Handler
TOnOrdersChanged onOrdersChangedHandler = NULL, // On Orders Changed Event Handler
TOnPositionsChanged onPositionsChangedHandler = NULL, // On Positions Changed Event Handler
TOnTradeStateChanged onTradeStateChangedHandler = NULL, // On Trade State Changed Event Handler
//
TOnSignal onSignalHandler = NULL, // On Signal Event Handler
//
// Log Handler ...
bool enableAlerts = true, // Enable Alerts
bool logAlerts = true, // Log Alerts
bool terminalAlerts = false, // Terminal Alerts
bool mailAlerts = false, // Mail Alerts
bool pushAlerts = false // Push Alerts
) : XSCBaseEA(slippage,
magicNumber,
manageInterval,
maxAllowedSpread,
maxAllowedPositions,
maxAllowedDrawdownFactor,
allowLong,
allowShort,
minProfitPerTrade,
minProfitPerVolumeFactor,
staticVolume,
onStopLossTriggered,
onTakeProfitTriggered,
onDealsChangedHandler,
onOrdersChangedHandler,
onPositionsChangedHandler,
onTradeStateChangedHandler,
enableAlerts,
logAlerts,
terminalAlerts,
mailAlerts,
pushAlerts //
)
{
}
//
// Deconstructor ...
~XSCX5EA() {}
//
// Properties Getter(s) / Setter(s) ...
//
// Add X5 Specified Signal Event Handler ...
void AddOnSignalEventHandler(TX5OnSignal listener)
{
//
Add(
listener,
mX5OnSignalEventHandlers
//
);
}
//
// Add Specified X5 Provider ...
bool AddProvider(X5ProviderDescriptor &descriptor)
{
//
bool result = false;
//
// Validate Inputs ...
result = descriptor.Init();
if (!result)
{
return result;
}
//
AddRef(
descriptor,
mDescriptors //
);
//
return result;
}
//
// Overrides ...
//
// Customize Token ...
string GetToken() override
{
return GetSpecificToken(this);
}
//
string GetTag() override
{
return this.GetToken();
}
//
// Check Provider for any Guards ...
bool CheckForGuard(XGuard &guards[]) override
{
//
// TODO: Implement this ...
return false;
}
//
// Request Provider to Collect all
// Potentially Signals and then
// filters theme here and passed them
// for Executing ...
int RequestForSignal(
XSignal &signals[] // Holds Signals ...
) override
{
//
bool result = 0;
//
Clean(signals);
//
int descriptorsCount = CountDescriptors();
if (descriptorsCount <= 0)
{
return result;
}
//
for (int i = 0; i < descriptorsCount; i++)
{
//
X5ProviderDescriptor iDescriptor = mDescriptors[i];
//
bool iHasSignal = iDescriptor.HasSignal();
if (iHasSignal)
{
//
// Here we Can double check Signals by Conditions
// for Score Base Filtering ...
//
AddRef(
iDescriptor.signal,
signals
//
);
//
NotifyX5OnSignalEventHandlers(iDescriptor);
}
}
//
result = ArraySize(signals);
//
return result;
}
//
// Handl Management Actions ...
// if returns true, it is going to prevent for processing forward ...
bool HandleStateManagement(XSignal &signals[]) override
{
//
// TODO: Implement this ...
return false;
}
//
// Request for Support Signals using Guard ...
bool RequestForSupport(
XSignal &support, // Holds Support Signal, if Provided
string provider, // Positions Provided by Specific Provider
string symbol, // Trading Symbol
ENUM_POSITION_TYPE type, // Trading Type
ENUM_TIMEFRAMES period // Specified Time Frame
) override
{
//
// TODO: Implement this ...
return false;
}
//
// Tools ...
//
// Protected ...
protected:
//
// Tools ...
//
void NotifyX5OnSignalEventHandlers(X5ProviderDescriptor &descriptor)
{
//
int listenersCount = ArraySize(mX5OnSignalEventHandlers);
if (listenersCount <= 0)
{
return;
}
//
for (int i = 0; i < listenersCount; i++)
{
//
TX5OnSignal iListener = mX5OnSignalEventHandlers[i];
//
iListener(descriptor);
}
}
//
// Private ...
private:
//
// Props ...
//
// Collection of Signal Event Listeners ...
TX5OnSignal mX5OnSignalEventHandlers[];
//
// a Collection of X5 Provider Descriptors ...
X5ProviderDescriptor mDescriptors[];
//
int CountDescriptors()
{
return ArraySize(mDescriptors);
}
//
// Tools ...
};
//
// Tools ...
+16 -8
View File
@@ -31,18 +31,18 @@
// //
// Inputs ... // Inputs ...
long x121EAMagicNumber = 78692110; // Magic Number long x121EAMagicNumber = 78692110; // Magic Number
int x121EASlippage = 10; // Slippgae int x121EASlippage = 10; // Slippgae
string x121EASymbols = "EURUSDb"; // Symbols string x121EASymbols = "EURUSDb,USDCHFb,GBPUSDb"; // Symbols
// //
bool x121EAAllowLong = true; // Allow Long Trades bool x121EAAllowLong = true; // Allow Long Trades
bool x121EAAllowShort = true; // Allow Short Trades bool x121EAAllowShort = true; // Allow Short Trades
int x121EAManageInterval = 0; // Manager Check Intervals Seconds int x121EAManageInterval = 0; // Manager Check Intervals Seconds
int x121EAMaxAllowedPositions = 10; // Max Allowed Positions int x121EAMaxAllowedPositions = 5; // Max Allowed Positions
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
double x121EAMinProfitPerTrade = 2; // Min Profit Per Trade based On Volume Factor (Hedge) double x121EAMinProfitPerTrade = 3; // Min Profit Per Trade based On Volume Factor (Hedge)
double x121EAMinProfitPerVolumeFactor = 0.01; // Min Volume Factor for Calculating Profit (Hedge) double x121EAMinProfitPerVolumeFactor = 0.01; // Min Volume Factor for Calculating Profit (Hedge)
double x121EAMaxAllowedDrawdownFactor = 0.005; // Max Allowed Drawdown Factor double x121EAMaxAllowedDrawdownFactor = 0.003; // Max Allowed Drawdown Factor
// //
double x121EAVolume = 0.01; double x121EAVolume = 0.01;
@@ -288,6 +288,14 @@ void ConfigureDescriptor(
X121ProviderDescriptor &iDescriptor // X121ProviderDescriptor &iDescriptor //
) )
{ {
//
// XHK ...
iDescriptor.inputs.tmInputs.showLine = false;
//
// XAMA ...
iDescriptor.inputs.amaInputs.showLine = false;
// //
// XHK ... // XHK ...
iDescriptor.inputs.hkInputs.drawHikenAshi = false; iDescriptor.inputs.hkInputs.drawHikenAshi = false;
@@ -295,8 +303,8 @@ void ConfigureDescriptor(
// //
// XMRB ... // XMRB ...
iDescriptor.inputs.mrbInputs.showFastMa = true; iDescriptor.inputs.mrbInputs.showFastMa = false;
iDescriptor.inputs.mrbInputs.showSlowMa = true; iDescriptor.inputs.mrbInputs.showSlowMa = false;
iDescriptor.inputs.mrbInputs.showRibbon = false; iDescriptor.inputs.mrbInputs.showRibbon = false;
// //
File diff suppressed because it is too large Load Diff
-252
View File
@@ -1,252 +0,0 @@
///////////////////////////////////////////////////////
//
// SaherElm IT Center X5EA MQL5 Expert Advisor
// -------------------------------------------------
// Name: X5EA
// Description: an Exper Advisor which used RSI and MA
// to Analyse Market ...
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////x
//
// Global Properties ...
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://saherelm.ir"
#property version "1.00"
#property description "SaherElm X5EA"
#property strict
//
#define ShortName "X5EA"
//
#include "../Classes/x-saherelm.x5.xea.class.mq5"
//
// "EURUSDb,USDCHFb,USDJPYb,XAUUSDb"
//
// Inputs ...
long x5EAMagicNumber = 78692110; // Magic Number
int x5EASlippage = 10; // Slippgae
string x5EASymbols = "EURUSDb,USDCHFb,USDJPYb,XAUUSDb"; // Symbols
//
bool x5EAAllowLong = true; // Allow Long Trades
bool x5EAAllowShort = true; // Allow Short Trades
int x5EAManageInterval = 5; // Manager Check Intervals Seconds
int x5EAMaxAllowedPositions = 15; // Max Allowed Positions
double x5EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
double x5EAMinProfitPerTrade = 0; // Min Profit Per Trade based On Volume Factor (Hedge)
double x5EAMinProfitPerVolumeFactor = 0; // Min Volume Factor for Calculating Profit (Hedge)
double x5EAMaxAllowedDrawdownFactor = 0; // Max Allowed Drawdown Factor
//
double x5EAVolume = 0.01;
//
// Vars ...
string x5EASymbol;
ENUM_TIMEFRAMES x5EAPeriod;
//
MqlTick x5EATick;
//
// X5EA ...
XSCX5EA *mX5EA;
//
// Event Handlers ...
//
// Initialization ...
int OnInit()
{
//
if (x5EASymbol == NULL || StringLen(x5EASymbol) <= 0)
{
x5EASymbol = _Symbol;
}
//
if (x5EAPeriod == NULL)
{
x5EAPeriod = _Period;
}
//
// Validate Inputs ...
if (!X5EAValidateInputs())
{
return INIT_PARAMETERS_INCORRECT;
}
//
// Initial EA ...
if (!InitialEA())
{
return INIT_PARAMETERS_INCORRECT;
}
//
TesterHideIndicators(true);
//
// Init Succeed ...
return INIT_SUCCEEDED;
}
//
// DeInitialization ...
void OnDeinit(const int reason)
{
//
// REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function
// REASON_REMOVE 1 Program removed from a chart
// REASON_RECOMPILE 2 Program recompiled
// REASON_CHARTCHANGE 3 A symbol or a chart period is changed
// REASON_CHARTCLOSE 4 Chart closed
// REASON_PARAMETERS 5 Inputs changed by a user
// REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings
// REASON_TEMPLATE 7 Another chart template applied
// REASON_INITFAILED 8 The OnInit() handler returned a non-zero value
// REASON_CLOSE 9 Terminal closed
//
// De Initialize X5EA Providers ...
}
//
// On Tick Handler ...
void OnTick()
{
//
// Reading Tick ...
if (!SymbolInfoTick(x5EASymbol, x5EATick))
{
return;
}
//
mX5EA.OnTick();
}
//
// Custom Functions ...
//
// Validate Variables nd Inputs ...
bool X5EAValidateInputs()
{
//
bool result = false;
//
result =
//
x5EASlippage > 0 &&
x5EAMagicNumber > 0
//
;
//
return result;
}
//
// Initialize Specific Providers ...
bool InitialEA()
{
//
bool result = false;
//
// Here We Have to Initial 4 instance of X5Provider ...
// - EURUSD/M5;
// - USDCHF/M5;
// - USDJPY/M5;
// - XAUUSD/M5;
//
result = IsValid(x5EASymbols);
if (!result)
{
return result;
}
//
string symbols[];
int symbolsCount = SplitContent(
symbols,
x5EASymbols);
result = symbolsCount > 0;
if (!result)
{
return result;
}
//
// Define Signallers ...
ENUM_X5_SIGNAL_PROVIDERS signallers[];
GetAllX5SignalProviders(signallers);
//
// Instantiate X5EA Class ...
mX5EA = new XSCX5EA(
x5EASlippage, // Slippgae
x5EAMagicNumber, // Magic Number
x5EAManageInterval, // Manager Check Intervals Seconds
x5EAMaxAllowedSpread, // Max Allowed Spred for Opening Trades
x5EAMaxAllowedPositions, // Max Allowed Positions
x5EAMaxAllowedDrawdownFactor, // Max Allowed Drawdown Factor
x5EAAllowLong, // Allow Long Trades
x5EAAllowShort, // Allow Short Trades
x5EAMinProfitPerTrade, // Min Profit Per Trade based On Volume Factor (Hedge)
x5EAMinProfitPerVolumeFactor // Min Volume Factor for Calculating Profit (Hedge)
);
//
// Prepare Providers and Add them into mX5EA class ...
for (int i = 0; i < symbolsCount; i++)
{
//
// Define Structure ...
X5ProviderDescriptor iDescriptor;
//
iDescriptor.symbol = symbols[i];
iDescriptor.period = PERIOD_M5;
iDescriptor.staticVolume = x5EAVolume;
iDescriptor.allowLong = x5EAAllowLong;
iDescriptor.allowShort = x5EAAllowShort;
Copy(
signallers,
iDescriptor.signallers);
//
// Set Inputs to Default ...
iDescriptor.inputs.Default();
//
// Validate Inputs ...
bool isInputsValid = iDescriptor.inputs.IsValid();
if (!isInputsValid)
{
continue;
}
//
result = mX5EA.AddProvider(iDescriptor);
if (!result)
{
break;
}
}
//
return result;
}
//
+52 -44
View File
@@ -118,11 +118,13 @@ input bool scDrawLL = true; // Draw Lowest Low
// //
// START Buffers ... // START Buffers ...
// //
#property indicator_separate_window // #property indicator_separate_window
#property indicator_chart_window
// //
#property indicator_buffers 7 #property indicator_buffers 7
#property indicator_plots 6 // #property indicator_plots 6
#property indicator_plots 0
// //
// LC ... // LC ...
@@ -412,26 +414,28 @@ void LCDefineBuffers()
string lcHHBufferLabel = ShortName + " LC HH (" + (string)lcLength + ")"; string lcHHBufferLabel = ShortName + " LC HH (" + (string)lcLength + ")";
ENUM_DRAW_TYPE lcHHDrawType = lcDrawHH ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE lcHHDrawType = lcDrawHH ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(lcHHBuffer, true); ArraySetAsSeries(lcHHBuffer, true);
SetIndexBuffer(lcHHBufferIndex, lcHHBuffer, INDICATOR_DATA); SetIndexBuffer(lcHHBufferIndex, lcHHBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(lcHHBufferIndex, PLOT_DRAW_BEGIN, lcLength); // SetIndexBuffer(lcHHBufferIndex, lcHHBuffer, INDICATOR_DATA);
PlotIndexSetString(lcHHBufferIndex, PLOT_LABEL, lcHHBufferLabel); // PlotIndexSetInteger(lcHHBufferIndex, PLOT_DRAW_BEGIN, lcLength);
PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_COLOR, lcHHColor); // PlotIndexSetString(lcHHBufferIndex, PLOT_LABEL, lcHHBufferLabel);
PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); // PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_COLOR, lcHHColor);
PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); // PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_STYLE, lcDrawStyle);
PlotIndexSetInteger(lcHHBufferIndex, PLOT_DRAW_TYPE, lcHHDrawType); // PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth);
// PlotIndexSetInteger(lcHHBufferIndex, PLOT_DRAW_TYPE, lcHHDrawType);
// //
// LC LL Buffer ... // LC LL Buffer ...
string lcLLBufferLabel = ShortName + " LC LL (" + (string)lcLength + ")"; string lcLLBufferLabel = ShortName + " LC LL (" + (string)lcLength + ")";
ENUM_DRAW_TYPE lcLLDrawType = lcDrawLL ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE lcLLDrawType = lcDrawLL ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(lcLLBuffer, true); ArraySetAsSeries(lcLLBuffer, true);
SetIndexBuffer(lcLLBufferIndex, lcLLBuffer, INDICATOR_DATA); SetIndexBuffer(lcLLBufferIndex, lcLLBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(lcLLBufferIndex, PLOT_DRAW_BEGIN, lcLength); // SetIndexBuffer(lcLLBufferIndex, lcLLBuffer, INDICATOR_DATA);
PlotIndexSetString(lcLLBufferIndex, PLOT_LABEL, lcLLBufferLabel); // PlotIndexSetInteger(lcLLBufferIndex, PLOT_DRAW_BEGIN, lcLength);
PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_COLOR, lcLLColor); // PlotIndexSetString(lcLLBufferIndex, PLOT_LABEL, lcLLBufferLabel);
PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); // PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_COLOR, lcLLColor);
PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); // PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_STYLE, lcDrawStyle);
PlotIndexSetInteger(lcLLBufferIndex, PLOT_DRAW_TYPE, lcLLDrawType); // PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth);
// PlotIndexSetInteger(lcLLBufferIndex, PLOT_DRAW_TYPE, lcLLDrawType);
} }
// //
@@ -443,26 +447,28 @@ void MCDefineBuffers()
string mcHHBufferLabel = ShortName + " MC HH (" + (string)mcLength + ")"; string mcHHBufferLabel = ShortName + " MC HH (" + (string)mcLength + ")";
ENUM_DRAW_TYPE mcHHDrawType = mcDrawHH ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE mcHHDrawType = mcDrawHH ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(mcHHBuffer, true); ArraySetAsSeries(mcHHBuffer, true);
SetIndexBuffer(mcHHBufferIndex, mcHHBuffer, INDICATOR_DATA); SetIndexBuffer(mcHHBufferIndex, mcHHBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(mcHHBufferIndex, PLOT_DRAW_BEGIN, mcLength); // SetIndexBuffer(mcHHBufferIndex, mcHHBuffer, INDICATOR_DATA);
PlotIndexSetString(mcHHBufferIndex, PLOT_LABEL, mcHHBufferLabel); // PlotIndexSetInteger(mcHHBufferIndex, PLOT_DRAW_BEGIN, mcLength);
PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_COLOR, mcHHColor); // PlotIndexSetString(mcHHBufferIndex, PLOT_LABEL, mcHHBufferLabel);
PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); // PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_COLOR, mcHHColor);
PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); // PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_STYLE, mcDrawStyle);
PlotIndexSetInteger(mcHHBufferIndex, PLOT_DRAW_TYPE, mcHHDrawType); // PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth);
// PlotIndexSetInteger(mcHHBufferIndex, PLOT_DRAW_TYPE, mcHHDrawType);
// //
// MC LL Buffer ... // MC LL Buffer ...
string mcLLBufferLabel = ShortName + " MC LL (" + (string)mcLength + ")"; string mcLLBufferLabel = ShortName + " MC LL (" + (string)mcLength + ")";
ENUM_DRAW_TYPE mcLLDrawType = mcDrawLL ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE mcLLDrawType = mcDrawLL ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(mcLLBuffer, true); ArraySetAsSeries(mcLLBuffer, true);
SetIndexBuffer(mcLLBufferIndex, mcLLBuffer, INDICATOR_DATA); SetIndexBuffer(mcLLBufferIndex, mcLLBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(mcLLBufferIndex, PLOT_DRAW_BEGIN, mcLength); // SetIndexBuffer(mcLLBufferIndex, mcLLBuffer, INDICATOR_DATA);
PlotIndexSetString(mcLLBufferIndex, PLOT_LABEL, mcLLBufferLabel); // PlotIndexSetInteger(mcLLBufferIndex, PLOT_DRAW_BEGIN, mcLength);
PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_COLOR, mcLLColor); // PlotIndexSetString(mcLLBufferIndex, PLOT_LABEL, mcLLBufferLabel);
PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); // PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_COLOR, mcLLColor);
PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); // PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_STYLE, mcDrawStyle);
PlotIndexSetInteger(mcLLBufferIndex, PLOT_DRAW_TYPE, mcLLDrawType); // PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth);
// PlotIndexSetInteger(mcLLBufferIndex, PLOT_DRAW_TYPE, mcLLDrawType);
} }
// //
@@ -474,26 +480,28 @@ void SCDefineBuffers()
string scHHBufferLabel = ShortName + " SC HH (" + (string)scLength + ")"; string scHHBufferLabel = ShortName + " SC HH (" + (string)scLength + ")";
ENUM_DRAW_TYPE scHHDrawType = scDrawHH ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE scHHDrawType = scDrawHH ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(scHHBuffer, true); ArraySetAsSeries(scHHBuffer, true);
SetIndexBuffer(scHHBufferIndex, scHHBuffer, INDICATOR_DATA); SetIndexBuffer(scHHBufferIndex, scHHBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(scHHBufferIndex, PLOT_DRAW_BEGIN, scLength); // SetIndexBuffer(scHHBufferIndex, scHHBuffer, INDICATOR_DATA);
PlotIndexSetString(scHHBufferIndex, PLOT_LABEL, scHHBufferLabel); // PlotIndexSetInteger(scHHBufferIndex, PLOT_DRAW_BEGIN, scLength);
PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_COLOR, scHHColor); // PlotIndexSetString(scHHBufferIndex, PLOT_LABEL, scHHBufferLabel);
PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_STYLE, scDrawStyle); // PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_COLOR, scHHColor);
PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); // PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_STYLE, scDrawStyle);
PlotIndexSetInteger(scHHBufferIndex, PLOT_DRAW_TYPE, scHHDrawType); // PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_WIDTH, scDrawWidth);
// PlotIndexSetInteger(scHHBufferIndex, PLOT_DRAW_TYPE, scHHDrawType);
// //
// SC LL Buffer ... // SC LL Buffer ...
string scLLBufferLabel = ShortName + " SC LL (" + (string)scLength + ")"; string scLLBufferLabel = ShortName + " SC LL (" + (string)scLength + ")";
ENUM_DRAW_TYPE scLLDrawType = scDrawLL ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE scLLDrawType = scDrawLL ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(scLLBuffer, true); ArraySetAsSeries(scLLBuffer, true);
SetIndexBuffer(scLLBufferIndex, scLLBuffer, INDICATOR_DATA); SetIndexBuffer(scLLBufferIndex, scLLBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(scLLBufferIndex, PLOT_DRAW_BEGIN, scLength); // SetIndexBuffer(scLLBufferIndex, scLLBuffer, INDICATOR_DATA);
PlotIndexSetString(scLLBufferIndex, PLOT_LABEL, scLLBufferLabel); // PlotIndexSetInteger(scLLBufferIndex, PLOT_DRAW_BEGIN, scLength);
PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_COLOR, scLLColor); // PlotIndexSetString(scLLBufferIndex, PLOT_LABEL, scLLBufferLabel);
PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_STYLE, scDrawStyle); // PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_COLOR, scLLColor);
PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); // PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_STYLE, scDrawStyle);
PlotIndexSetInteger(scLLBufferIndex, PLOT_DRAW_TYPE, scLLDrawType); // PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_WIDTH, scDrawWidth);
// PlotIndexSetInteger(scLLBufferIndex, PLOT_DRAW_TYPE, scLLDrawType);
} }
// //
+52 -44
View File
@@ -121,11 +121,13 @@ input bool scDrawCrosses = false; // Draw Cross Lines
// //
// START Buffers ... // START Buffers ...
// //
#property indicator_separate_window // #property indicator_separate_window
#property indicator_chart_window
// //
#property indicator_buffers 7 #property indicator_buffers 7
#property indicator_plots 6 // #property indicator_plots 6
#property indicator_plots 0
// //
// LC ... // LC ...
@@ -519,26 +521,28 @@ void LCDefineBuffers()
string lcFastBufferLabel = ShortName + " LC Fast (" + (string)lcFastLength + ")"; string lcFastBufferLabel = ShortName + " LC Fast (" + (string)lcFastLength + ")";
ENUM_DRAW_TYPE lcFastDrawType = lcDrawFast ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE lcFastDrawType = lcDrawFast ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(lcFastBuffer, true); ArraySetAsSeries(lcFastBuffer, true);
SetIndexBuffer(lcFastBufferIndex, lcFastBuffer, INDICATOR_DATA); SetIndexBuffer(lcFastBufferIndex, lcFastBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(lcFastBufferIndex, PLOT_LABEL, lcFastBufferLabel); // SetIndexBuffer(lcFastBufferIndex, lcFastBuffer, INDICATOR_DATA);
PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_COLOR, lcFastColor); // PlotIndexSetString(lcFastBufferIndex, PLOT_LABEL, lcFastBufferLabel);
PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); // PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_COLOR, lcFastColor);
PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); // PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_STYLE, lcDrawStyle);
PlotIndexSetInteger(lcFastBufferIndex, PLOT_DRAW_BEGIN, lcFastLength); // PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth);
PlotIndexSetInteger(lcFastBufferIndex, PLOT_DRAW_TYPE, lcFastDrawType); // PlotIndexSetInteger(lcFastBufferIndex, PLOT_DRAW_BEGIN, lcFastLength);
// PlotIndexSetInteger(lcFastBufferIndex, PLOT_DRAW_TYPE, lcFastDrawType);
// //
// LC Slow Buffer ... // LC Slow Buffer ...
string lcSlowBufferLabel = ShortName + " LC Slow (" + (string)lcSlowLength + ")"; string lcSlowBufferLabel = ShortName + " LC Slow (" + (string)lcSlowLength + ")";
ENUM_DRAW_TYPE lcSlowDrawType = lcDrawSlow ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE lcSlowDrawType = lcDrawSlow ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(lcSlowBuffer, true); ArraySetAsSeries(lcSlowBuffer, true);
SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer, INDICATOR_DATA); SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(lcSlowBufferIndex, PLOT_LABEL, lcSlowBufferLabel); // SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer, INDICATOR_DATA);
PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_COLOR, lcSlowColor); // PlotIndexSetString(lcSlowBufferIndex, PLOT_LABEL, lcSlowBufferLabel);
PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_COLOR, lcSlowColor);
PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_STYLE, lcDrawStyle);
PlotIndexSetInteger(lcSlowBufferIndex, PLOT_DRAW_BEGIN, lcSlowLength); // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth);
PlotIndexSetInteger(lcSlowBufferIndex, PLOT_DRAW_TYPE, lcSlowDrawType); // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_DRAW_BEGIN, lcSlowLength);
// PlotIndexSetInteger(lcSlowBufferIndex, PLOT_DRAW_TYPE, lcSlowDrawType);
} }
// //
@@ -550,26 +554,28 @@ void MCDefineBuffers()
string mcFastBufferLabel = ShortName + " MC Fast (" + (string)mcFastLength + ")"; string mcFastBufferLabel = ShortName + " MC Fast (" + (string)mcFastLength + ")";
ENUM_DRAW_TYPE mcFastDrawType = mcDrawFast ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE mcFastDrawType = mcDrawFast ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(mcFastBuffer, true); ArraySetAsSeries(mcFastBuffer, true);
SetIndexBuffer(mcFastBufferIndex, mcFastBuffer, INDICATOR_DATA); SetIndexBuffer(mcFastBufferIndex, mcFastBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(mcFastBufferIndex, PLOT_LABEL, mcFastBufferLabel); // SetIndexBuffer(mcFastBufferIndex, mcFastBuffer, INDICATOR_DATA);
PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_COLOR, mcFastColor); // PlotIndexSetString(mcFastBufferIndex, PLOT_LABEL, mcFastBufferLabel);
PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); // PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_COLOR, mcFastColor);
PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); // PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_STYLE, mcDrawStyle);
PlotIndexSetInteger(mcFastBufferIndex, PLOT_DRAW_BEGIN, mcFastLength); // PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth);
PlotIndexSetInteger(mcFastBufferIndex, PLOT_DRAW_TYPE, mcFastDrawType); // PlotIndexSetInteger(mcFastBufferIndex, PLOT_DRAW_BEGIN, mcFastLength);
// PlotIndexSetInteger(mcFastBufferIndex, PLOT_DRAW_TYPE, mcFastDrawType);
// //
// MC Slow Buffer ... // MC Slow Buffer ...
string mcSlowBufferLabel = ShortName + " MC Slow (" + (string)mcSlowLength + ")"; string mcSlowBufferLabel = ShortName + " MC Slow (" + (string)mcSlowLength + ")";
ENUM_DRAW_TYPE mcSlowDrawType = mcDrawSlow ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE mcSlowDrawType = mcDrawSlow ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(mcSlowBuffer, true); ArraySetAsSeries(mcSlowBuffer, true);
SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer, INDICATOR_DATA); SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(mcSlowBufferIndex, PLOT_LABEL, mcSlowBufferLabel); // SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer, INDICATOR_DATA);
PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_COLOR, mcSlowColor); // PlotIndexSetString(mcSlowBufferIndex, PLOT_LABEL, mcSlowBufferLabel);
PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_COLOR, mcSlowColor);
PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_STYLE, mcDrawStyle);
PlotIndexSetInteger(mcSlowBufferIndex, PLOT_DRAW_BEGIN, mcSlowLength); // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth);
PlotIndexSetInteger(mcSlowBufferIndex, PLOT_DRAW_TYPE, mcSlowDrawType); // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_DRAW_BEGIN, mcSlowLength);
// PlotIndexSetInteger(mcSlowBufferIndex, PLOT_DRAW_TYPE, mcSlowDrawType);
} }
// //
@@ -581,26 +587,28 @@ void SCDefineBuffers()
string scFastBufferLabel = ShortName + " SC Fast (" + (string)scFastLength + ")"; string scFastBufferLabel = ShortName + " SC Fast (" + (string)scFastLength + ")";
ENUM_DRAW_TYPE scFastDrawType = scDrawFast ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE scFastDrawType = scDrawFast ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(scFastBuffer, true); ArraySetAsSeries(scFastBuffer, true);
SetIndexBuffer(scFastBufferIndex, scFastBuffer, INDICATOR_DATA); SetIndexBuffer(scFastBufferIndex, scFastBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(scFastBufferIndex, PLOT_LABEL, scFastBufferLabel); // SetIndexBuffer(scFastBufferIndex, scFastBuffer, INDICATOR_DATA);
PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_COLOR, scFastColor); // PlotIndexSetString(scFastBufferIndex, PLOT_LABEL, scFastBufferLabel);
PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_STYLE, scDrawStyle); // PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_COLOR, scFastColor);
PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); // PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_STYLE, scDrawStyle);
PlotIndexSetInteger(scFastBufferIndex, PLOT_DRAW_BEGIN, scFastLength); // PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_WIDTH, scDrawWidth);
PlotIndexSetInteger(scFastBufferIndex, PLOT_DRAW_TYPE, scFastDrawType); // PlotIndexSetInteger(scFastBufferIndex, PLOT_DRAW_BEGIN, scFastLength);
// PlotIndexSetInteger(scFastBufferIndex, PLOT_DRAW_TYPE, scFastDrawType);
// //
// SC Slow Buffer ... // SC Slow Buffer ...
string scSlowBufferLabel = ShortName + " SC Slow (" + (string)scSlowLength + ")"; string scSlowBufferLabel = ShortName + " SC Slow (" + (string)scSlowLength + ")";
ENUM_DRAW_TYPE scSlowDrawType = scDrawSlow ? lcDrawType : DRAW_NONE; ENUM_DRAW_TYPE scSlowDrawType = scDrawSlow ? lcDrawType : DRAW_NONE;
ArraySetAsSeries(scSlowBuffer, true); ArraySetAsSeries(scSlowBuffer, true);
SetIndexBuffer(scSlowBufferIndex, scSlowBuffer, INDICATOR_DATA); SetIndexBuffer(scSlowBufferIndex, scSlowBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(scSlowBufferIndex, PLOT_LABEL, scSlowBufferLabel); // SetIndexBuffer(scSlowBufferIndex, scSlowBuffer, INDICATOR_DATA);
PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_COLOR, scSlowColor); // PlotIndexSetString(scSlowBufferIndex, PLOT_LABEL, scSlowBufferLabel);
PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_STYLE, scDrawStyle); // PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_COLOR, scSlowColor);
PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); // PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_STYLE, scDrawStyle);
PlotIndexSetInteger(scSlowBufferIndex, PLOT_DRAW_BEGIN, scSlowLength); // PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_WIDTH, scDrawWidth);
PlotIndexSetInteger(scSlowBufferIndex, PLOT_DRAW_TYPE, scSlowDrawType); // PlotIndexSetInteger(scSlowBufferIndex, PLOT_DRAW_BEGIN, scSlowLength);
// PlotIndexSetInteger(scSlowBufferIndex, PLOT_DRAW_TYPE, scSlowDrawType);
} }
// //
+16 -12
View File
@@ -45,11 +45,13 @@ input ENUM_APPLIED_VOLUME appliedTo = VOLUME_TICK; // Applied To
// //
// START Buffers ... // START Buffers ...
// //
#property indicator_separate_window // #property indicator_separate_window
#property indicator_chart_window
// //
#property indicator_buffers 2 #property indicator_buffers 2
#property indicator_plots 1 // #property indicator_plots 1
#property indicator_plots 0
// //
// FI Buffer ... // FI Buffer ...
@@ -61,11 +63,11 @@ double fiBuffer[];
double fiColorBuffer[]; double fiColorBuffer[];
// //
#property indicator_label1 "XFI" // #property indicator_label1 "XFI"
#property indicator_type1 DRAW_COLOR_LINE // #property indicator_type1 DRAW_COLOR_LINE
#property indicator_color1 clrAqua, clrGray, clrFuchsia // #property indicator_color1 clrAqua, clrGray, clrFuchsia
#property indicator_style1 STYLE_DOT // #property indicator_style1 STYLE_DOT
#property indicator_width1 1 // #property indicator_width1 1
// //
// END Buffers ... // END Buffers ...
// //
@@ -261,13 +263,15 @@ void DefineBuffers()
// //
// FI Buffer ... // FI Buffer ...
ArraySetAsSeries(fiBuffer, true); ArraySetAsSeries(fiBuffer, true);
SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_DATA); SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetString(fiBufferIndex, PLOT_LABEL, fiBufferLabel); // SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_DATA);
// PlotIndexSetString(fiBufferIndex, PLOT_LABEL, fiBufferLabel);
// // //
// FI Color Buffer ... // // FI Color Buffer ...
ArraySetAsSeries(fiColorBuffer, true); ArraySetAsSeries(fiColorBuffer, true);
SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_COLOR_INDEX); // SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_COLOR_INDEX);
SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_CALCULATIONS);
} }
// //
+17 -13
View File
@@ -75,9 +75,11 @@ input ENUM_LINE_STYLE longExitLineStyle = STYLE_DOT; // Long Exit Style
// //
// //
#property indicator_separate_window // #property indicator_separate_window
#property indicator_chart_window
#property indicator_buffers 2 #property indicator_buffers 2
#property indicator_plots 1 // #property indicator_plots 1
#property indicator_plots 0
// //
#define rsiBufferIndex 0 #define rsiBufferIndex 0
@@ -88,11 +90,11 @@ double rsiBuffer[];
double rsiColorBuffer[]; double rsiColorBuffer[];
// //
#property indicator_label1 "XRSI" // #property indicator_label1 "XRSI"
#property indicator_type1 DRAW_COLOR_LINE // #property indicator_type1 DRAW_COLOR_LINE
#property indicator_color1 clrAqua, clrGray, clrFuchsia // #property indicator_color1 clrAqua, clrGray, clrFuchsia
#property indicator_style1 STYLE_DOT // #property indicator_style1 STYLE_DOT
#property indicator_width1 1 // #property indicator_width1 1
// //
// END Buffers ... // END Buffers ...
@@ -288,14 +290,16 @@ void DefineBuffers()
// RSI ... // RSI ...
string rsiBufferLabel = ShortName + " (" + (string)length + ")"; string rsiBufferLabel = ShortName + " (" + (string)length + ")";
ArraySetAsSeries(rsiBuffer, true); ArraySetAsSeries(rsiBuffer, true);
SetIndexBuffer(rsiBufferIndex, rsiBuffer, INDICATOR_DATA); SetIndexBuffer(rsiBufferIndex, rsiBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(rsiBufferIndex, PLOT_DRAW_BEGIN, length); // SetIndexBuffer(rsiBufferIndex, rsiBuffer, INDICATOR_DATA);
PlotIndexSetString(rsiBufferIndex, PLOT_LABEL, rsiBufferLabel); // PlotIndexSetInteger(rsiBufferIndex, PLOT_DRAW_BEGIN, length);
// PlotIndexSetString(rsiBufferIndex, PLOT_LABEL, rsiBufferLabel);
// // //
// RSI Color Buffer ... // // RSI Color Buffer ...
ArraySetAsSeries(rsiColorBuffer, true); ArraySetAsSeries(rsiColorBuffer, true);
SetIndexBuffer(rsiColorBufferIndex, rsiColorBuffer, INDICATOR_COLOR_INDEX); SetIndexBuffer(rsiColorBufferIndex, rsiColorBuffer, INDICATOR_CALCULATIONS);
// SetIndexBuffer(rsiColorBufferIndex, rsiColorBuffer, INDICATOR_COLOR_INDEX);
// //
// Set Indicator Levels here ... // Set Indicator Levels here ...
+31 -26
View File
@@ -68,11 +68,13 @@ input color bearishArrowColor = clrMagenta; // Cross Under Arrow Color
// //
// START Buffers ... // START Buffers ...
// //
#property indicator_separate_window // #property indicator_separate_window
#property indicator_chart_window
// //
#property indicator_buffers 3 #property indicator_buffers 3
#property indicator_plots 3 // #property indicator_plots 3
#property indicator_plots 0
// //
#define bullishBufferIndex 0 #define bullishBufferIndex 0
@@ -85,25 +87,25 @@ double bearishBuffer[];
double signalBuffer[]; double signalBuffer[];
// //
#property indicator_label1 "XBullPower" // #property indicator_label1 "XBullPower"
#property indicator_type1 DRAW_LINE // #property indicator_type1 DRAW_LINE
#property indicator_color1 clrLime // #property indicator_color1 clrLime
#property indicator_style1 STYLE_SOLID // #property indicator_style1 STYLE_SOLID
#property indicator_width1 1 // #property indicator_width1 1
// //
#property indicator_label2 "XBearPower" // #property indicator_label2 "XBearPower"
#property indicator_type2 DRAW_LINE // #property indicator_type2 DRAW_LINE
#property indicator_color2 clrRed // #property indicator_color2 clrRed
#property indicator_style2 STYLE_SOLID // #property indicator_style2 STYLE_SOLID
#property indicator_width2 1 // #property indicator_width2 1
// //
#property indicator_label3 "XSignal" // #property indicator_label3 "XSignal"
#property indicator_type3 DRAW_LINE // #property indicator_type3 DRAW_LINE
#property indicator_color3 clrGold // #property indicator_color3 clrGold
#property indicator_style3 STYLE_DOT // #property indicator_style3 STYLE_DOT
#property indicator_width3 1 // #property indicator_width3 1
// //
// END Buffers ... // END Buffers ...
// //
@@ -273,25 +275,28 @@ void DefineBuffers()
// Bullish Buffer ... // Bullish Buffer ...
string bullishBufferLabel = ShortName + "BullPow " + "(" + (string)length + ")"; string bullishBufferLabel = ShortName + "BullPow " + "(" + (string)length + ")";
ArraySetAsSeries(bullishBuffer, true); ArraySetAsSeries(bullishBuffer, true);
SetIndexBuffer(bullishBufferIndex, bullishBuffer, INDICATOR_DATA); SetIndexBuffer(bullishBufferIndex, bullishBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(bullishBufferIndex, PLOT_DRAW_BEGIN, length); // SetIndexBuffer(bullishBufferIndex, bullishBuffer, INDICATOR_DATA);
PlotIndexSetString(bullishBufferIndex, PLOT_LABEL, bullishBufferLabel); // PlotIndexSetInteger(bullishBufferIndex, PLOT_DRAW_BEGIN, length);
// PlotIndexSetString(bullishBufferIndex, PLOT_LABEL, bullishBufferLabel);
// //
// Bearish Buffer ... // Bearish Buffer ...
string bearishBufferLabel = ShortName + "BearPow " + "(" + (string)length + ")"; string bearishBufferLabel = ShortName + "BearPow " + "(" + (string)length + ")";
ArraySetAsSeries(bearishBuffer, true); ArraySetAsSeries(bearishBuffer, true);
SetIndexBuffer(bearishBufferIndex, bearishBuffer, INDICATOR_DATA); SetIndexBuffer(bearishBufferIndex, bearishBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(bearishBufferIndex, PLOT_DRAW_BEGIN, length); // SetIndexBuffer(bearishBufferIndex, bearishBuffer, INDICATOR_DATA);
PlotIndexSetString(bearishBufferIndex, PLOT_LABEL, bearishBufferLabel); // PlotIndexSetInteger(bearishBufferIndex, PLOT_DRAW_BEGIN, length);
// PlotIndexSetString(bearishBufferIndex, PLOT_LABEL, bearishBufferLabel);
// //
// Signal Buffer ... // Signal Buffer ...
string signalBufferLabel = ShortName + "Signal " + "(" + (string)length + ")"; string signalBufferLabel = ShortName + "Signal " + "(" + (string)length + ")";
ArraySetAsSeries(signalBuffer, true); ArraySetAsSeries(signalBuffer, true);
SetIndexBuffer(signalBufferIndex, signalBuffer, INDICATOR_DATA); SetIndexBuffer(signalBufferIndex, signalBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(signalBufferIndex, PLOT_DRAW_BEGIN, length); // SetIndexBuffer(signalBufferIndex, signalBuffer, INDICATOR_DATA);
PlotIndexSetString(signalBufferIndex, PLOT_LABEL, signalBufferLabel); // PlotIndexSetInteger(signalBufferIndex, PLOT_DRAW_BEGIN, length);
// PlotIndexSetString(signalBufferIndex, PLOT_LABEL, signalBufferLabel);
} }
// //
+36 -30
View File
@@ -62,11 +62,13 @@ input ENUM_APPLIED_PRICE farestAppliedTo = PRICE_CLOSE; // Farest Applied To
// //
// START Buffers ... // START Buffers ...
// //
#property indicator_separate_window // #property indicator_separate_window
#property indicator_chart_window
// //
#property indicator_buffers 4 #property indicator_buffers 4
#property indicator_plots 4 // #property indicator_plots 4
#property indicator_plots 0
// //
// Current ... // Current ...
@@ -74,11 +76,11 @@ input ENUM_APPLIED_PRICE farestAppliedTo = PRICE_CLOSE; // Farest Applied To
double currentBuffer[]; double currentBuffer[];
#property indicator_label1 "XTS C" // #property indicator_label1 "XTS C"
#property indicator_type1 DRAW_LINE // #property indicator_type1 DRAW_LINE
#property indicator_color1 clrBrown // #property indicator_color1 clrBrown
#property indicator_style1 STYLE_SOLID // #property indicator_style1 STYLE_SOLID
#property indicator_width1 1 // #property indicator_width1 1
// //
// Nearest ... // Nearest ...
@@ -86,11 +88,11 @@ double currentBuffer[];
double nearestBuffer[]; double nearestBuffer[];
#property indicator_label2 "XTS N" // #property indicator_label2 "XTS N"
#property indicator_type2 DRAW_LINE // #property indicator_type2 DRAW_LINE
#property indicator_color2 clrAqua // #property indicator_color2 clrAqua
#property indicator_style2 STYLE_SOLID // #property indicator_style2 STYLE_SOLID
#property indicator_width2 1 // #property indicator_width2 1
// //
// Mediest ... // Mediest ...
@@ -98,11 +100,11 @@ double nearestBuffer[];
double mediestBuffer[]; double mediestBuffer[];
#property indicator_label3 "XTS M" // #property indicator_label3 "XTS M"
#property indicator_type3 DRAW_LINE // #property indicator_type3 DRAW_LINE
#property indicator_color3 clrLime // #property indicator_color3 clrLime
#property indicator_style3 STYLE_SOLID // #property indicator_style3 STYLE_SOLID
#property indicator_width3 1 // #property indicator_width3 1
// //
// Farest ... // Farest ...
@@ -110,11 +112,11 @@ double mediestBuffer[];
double farestBuffer[]; double farestBuffer[];
#property indicator_label4 "XTS F" // #property indicator_label4 "XTS F"
#property indicator_type4 DRAW_LINE // #property indicator_type4 DRAW_LINE
#property indicator_color4 clrLightBlue // #property indicator_color4 clrLightBlue
#property indicator_style4 STYLE_SOLID // #property indicator_style4 STYLE_SOLID
#property indicator_width4 1 // #property indicator_width4 1
// //
// END Buffers ... // END Buffers ...
@@ -273,26 +275,30 @@ void DefineBuffers()
// //
// Current ... // Current ...
ArraySetAsSeries(currentBuffer, true); ArraySetAsSeries(currentBuffer, true);
SetIndexBuffer(currentBufferIndex, currentBuffer, INDICATOR_DATA); SetIndexBuffer(currentBufferIndex, currentBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(currentBufferIndex, PLOT_DRAW_BEGIN, maxLength); // SetIndexBuffer(currentBufferIndex, currentBuffer, INDICATOR_DATA);
// PlotIndexSetInteger(currentBufferIndex, PLOT_DRAW_BEGIN, maxLength);
// //
// Nearest ... // Nearest ...
ArraySetAsSeries(nearestBuffer, true); ArraySetAsSeries(nearestBuffer, true);
SetIndexBuffer(nearestBufferIndex, nearestBuffer, INDICATOR_DATA); SetIndexBuffer(nearestBufferIndex, nearestBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(nearestBufferIndex, PLOT_DRAW_BEGIN, maxLength); // SetIndexBuffer(nearestBufferIndex, nearestBuffer, INDICATOR_DATA);
// PlotIndexSetInteger(nearestBufferIndex, PLOT_DRAW_BEGIN, maxLength);
// //
// Mediest ... // Mediest ...
ArraySetAsSeries(mediestBuffer, true); ArraySetAsSeries(mediestBuffer, true);
SetIndexBuffer(mediestBufferIndex, mediestBuffer, INDICATOR_DATA); SetIndexBuffer(mediestBufferIndex, mediestBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(mediestBufferIndex, PLOT_DRAW_BEGIN, maxLength); // SetIndexBuffer(mediestBufferIndex, mediestBuffer, INDICATOR_DATA);
// PlotIndexSetInteger(mediestBufferIndex, PLOT_DRAW_BEGIN, maxLength);
// //
// Farest ... // Farest ...
ArraySetAsSeries(farestBuffer, true); ArraySetAsSeries(farestBuffer, true);
SetIndexBuffer(farestBufferIndex, farestBuffer, INDICATOR_DATA); SetIndexBuffer(farestBufferIndex, farestBuffer, INDICATOR_CALCULATIONS);
PlotIndexSetInteger(farestBufferIndex, PLOT_DRAW_BEGIN, maxLength); // SetIndexBuffer(farestBufferIndex, farestBuffer, INDICATOR_DATA);
// PlotIndexSetInteger(farestBufferIndex, PLOT_DRAW_BEGIN, maxLength);
} }
// //