Miami Lakes
Experience: Beginner
Platform: Multicharts
Broker: Interactive Brokers
Trading: Emini ES
Posts: 19 since Oct 2016
Thanks Given: 2
Thanks Received: 3
|
Hi everyone,
I am new to Multicharts and EL, relatively new to futures trading. Looking around for something to get started with, I came across with this signal. Please excuse any possible redundant code or maybe there is something that could be done in such an easier way, but this is completely new for me. With this strategy I am basically looking for a reversal once the price goes outside the channel. Stochastic is used for an exit. I am also adding a text with the current ATR value just to look at it, I like it always higher than 2. If good, this is something I would trade only in ES futures.
[IntrabarOrderGeneration = false]
inputs: Price(Close), Length(20), NumATRs(2), StartTime(0830), EndTime(1430);
inputs: StochLength(14), OverSold(20), OverBought(80);
variables: accountLoc(1), Hammer(0), positionSize(0), factor(0),
LowerBand(0), UpperBand(0), mean(0), ATR(0), LEConditions(false),
SEConditions(false), LXConditions(false), SXConditions(false), StoUp(false), StoDn(false),
HighTLColor (darkgreen),
HighTextColor (darkgreen),ATRTxt(0),
var0(0),var1(0),var2(0),var3(0);
mean = AverageFC(Price, Length);
ATR = AvgTrueRange( Length );
factor = ATR * NumATRs;
LowerBand = mean - factor;
UpperBand = mean + factor;
Hammer = (High - Low)/4;
//ATR
if LastBarOnChart then
begin
Text_Delete(ATRTxt);
ATRTxt = Text_New(date, time, high, text(" ATR:" + text(ATR) + text(" ")));
Text_setcolor(ATRTxt,yellow);
Text_SetBGColor(ATRTxt,darkblue);
Text_SetLocation(ATRTxt, date, time, GetAppInfo(aiHighestDispValue) - (10 * MinMove/PriceScale));
end;
Value1 = Stochastic(H, L, C, StochLength, 3, 3, 1, var0, var1, var2, var3);
LEConditions =
(
(High-Close) <= Hammer ) and ( ( Close crosses over LowerBand )
or ( (Low <= LowerBand) and (Close > LowerBand) )
or ( (Low <= LowerBand) and (Close > Open) and (Close > LowerBand) )
)
and ( Time > StartTime and Time < EndTime )
;
SEConditions =
( (Close-Low) <= Hammer ) and ( Close crosses below UpperBand )
and ( Time > StartTime and Time < EndTime )
;
LXConditions =
(Close crosses below UpperBand) or
(Close crosses below LowerBand) or
( (Close crosses below mean) ) or
( (var0 crosses under var1) )
;
SXConditions =
(Close crosses over LowerBand) or
(Close crosses over UpperBand) or
(Close crosses over mean) or
( (var0 crosses over var1) and (var0 < OverSold) )
;
if MarketPosition = 0 then begin
if LEConditions then begin
buy ( "KC+STO_LE" ) 1 contracts next bar at market;
end;
if SEConditions then begin
sellshort ( "KC+STO_SE" ) 1 contracts next bar at market;
end;
end;
if (MarketPosition = 1) then begin
if (LXConditions) then begin
if (CurrentContracts = 1) then begin
sell ( "KC+STO_LX" ) 1 contracts next bar at market;
end;
end;
end;
if (MarketPosition = -1) then begin
if (SXConditions) then begin
if (CurrentContracts = 1) then begin
buytocover ( "KC+STO_SX" ) 1 contracts next bar at market;
end;
end;
end;
I was wondering if anyone can give me some feedback on this please, do you think this could be something that would work long term? I know this won't be something that will generate a signal everyday, but again I am just looking for something to get started with. If you think this will never work, please share it as well, that'll help too. Any help will be truly appreciated.
|