Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Bot Marco Baruzzi QTA Forum //
- Questa strategia è stata pubblicata da Marco Baruzzi sul forum della quant
- ma bisogna spulciarla tutta dalla a alla z passo passo.
- ---------------------------------------------
- La strategia lavora su questi sottostanti tutti insieme intesi come portafoglio:
- ---------------------------------------------
- Date Tested: 2014-2024
- TF: 15 min
- Symbols: AMZN, AVGO, TSLA, AMD
- ---------------------------------------------
- Inputs: isSampleOutOfSampleActive(0), displayMode(1);
- if isSampleOutOfSampleActive = 0 or (
- ((displayMode = 1 or displayMode = 3) and isSampleOutOfSampleActive = 1 and ((Date >= 1140102 and Date <= 1163554) or (Date >= 1173607 and Date <= 1197059) or (Date >= 1207112 and Date <= 1230564) or marketposition <> 0)) or
- ((displayMode = 2 or displayMode = 3) and isSampleOutOfSampleActive = 1 and ((Date > 1163555 and Date <= 1173606) or (Date > 1197060 and Date <= 1207111) or (Date > 1230565 and Date <= 1240616) or marketposition <> 0))) then begin
- inputs: lookback(10), consecFallingATR(4), periodATR(5), periodAVG(5);
- vars: Nshares(0), ATRMovingAverage(0), CurrentAtr(0);
- CurrentAtr = averagetruerange(periodATR);
- ATRMovingAverage = Average(currentatr, periodATR);
- AvgVolume = Average(Volume, periodAVG);
- condition1 = c > Average(c,periodAVG);
- condition2 = CountIf (CurrentAtr < CurrentAtr[1], lookback) >= consecFallingATR; //CurrentAtr < ATRMovingAverage; //
- Nshares = (InitialCapital+netprofit)/4/Close;
- if condition1 and condition2 then buy Nshares shares next bar HighD(0) stop;
- sell next bar LowD(0) stop;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement