automated trading - code vba 5


/ Published in: Visual Basic
Save to your folder(s)



Copy this code and paste it in your HTML
  1. '----------------------------
  2. '----------------------------
  3. ' protections (start)
  4. '----------------------------
  5. '----------------------------
  6.  
  7. '>>>>>>>>>>>>new
  8. If ((itrade = 1) And (icomesell_save = 1) And (ikc < 100)) Then
  9. If (ibuy = 1) Then
  10. toto = shtDB.Range("A1").Cells(i, 1).Value - xenter_ini 'intra_close(ik, ikc) - intra_close(ik, ikc0)
  11. If (toto < -30) Then cond_break_buystrategy = True
  12. End If
  13. End If
  14.  
  15. If ((itrade = 3) And (itradelong = 1) And (itradeshort = 1)) Then
  16. t1 = shtTrading.Range("F2").Cells(1, 1).Value 'temp_tradesshort(1)
  17. t2 = shtTrading.Range("E2").Cells(1, 1).Value 'temp_tradeslong(1)
  18. t3 = shtTrading.Range("D2").Cells(3, 1).Value 'temp_trades(3)
  19. If ((t1 > 40) And (ikc < 800)) Then
  20. If ((t2 < -20) And (t3 = 0)) Then ibreak = 1
  21. End If
  22. End If
  23.  
  24.  
  25. If ((itrade = 2)) Then
  26. t1 = shtTrading.Range("D2").Cells(1, 1).Value 'temp_trades(1)
  27. t2 = shtTrading.Range("D2").Cells(2, 1).Value 'temp_trades(2)
  28. If ((temp_save < -60) And (t2 = 0)) Then ibreak = 1
  29. End If

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.