Advertisement
Maurizio-Ciullo

Bot Marco Baruzzi QTA Forum

Jun 11th, 2024
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Bot Marco Baruzzi QTA Forum //
  2.  
  3. Questa strategia è stata pubblicata da Marco Baruzzi sul forum della quant
  4. ma bisogna spulciarla tutta dalla a alla z passo passo.
  5. ---------------------------------------------
  6. La strategia lavora su questi sottostanti tutti insieme intesi come portafoglio:
  7. ---------------------------------------------
  8. Date Tested: 2014-2024
  9. TF: 15 min
  10. Symbols: AMZN, AVGO, TSLA, AMD
  11. ---------------------------------------------
  12.  
  13. Inputs: isSampleOutOfSampleActive(0), displayMode(1);
  14. if isSampleOutOfSampleActive = 0 or (
  15. ((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
  16. ((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
  17.  
  18. inputs: lookback(10), consecFallingATR(4), periodATR(5), periodAVG(5);
  19.  
  20. vars: Nshares(0), ATRMovingAverage(0), CurrentAtr(0);
  21.  
  22. CurrentAtr = averagetruerange(periodATR);
  23. ATRMovingAverage = Average(currentatr, periodATR);
  24. AvgVolume = Average(Volume, periodAVG);
  25.  
  26. condition1 = c > Average(c,periodAVG);
  27. condition2 = CountIf (CurrentAtr  < CurrentAtr[1], lookback) >= consecFallingATR; //CurrentAtr < ATRMovingAverage; //
  28.  
  29. Nshares = (InitialCapital+netprofit)/4/Close;
  30.  
  31. if condition1 and condition2 then buy Nshares shares next bar HighD(0) stop;
  32. sell next bar LowD(0) stop;
  33.  
  34. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement