SlideShare una empresa de Scribd logo
Creando un sistema de 
trading con promedios 
móviles
Objetivo 
Crear un sistema de “trading” mediante un 
algoritmo basado en el indicador de análisis 
técnico Promedio Móvil, para crear un código y 
realizar pruebas hacia atrás en una plataforma 
de “trading”, y con ello validar su eficiencia.
Parámetros 
promedio rápido de 20 períodos (MA20) 
promedio lento de 50 períodos (MA50) 
Aministración del dinero: 
Relación toma de utilidades a riesgo: 2 a 1
Algoritmo 
Se genera una señal de compra cuando un 
promedio móvil rápido cruza un segundo 
promedio móvil lento y el cruce se encuentra 
debajo del precio.
Condición para señal de compra 
Promedio lento: 
50 períodos 
Promedio rápido: 
20 períodos 
c) MA20 < Ask 
0 
1 
2 
b) MA20 > MA50 en shift 1 
a) MA20 < MA50 en shift 2
Pseudo código 
1. Obtener los promedios móviles 
2. Obtener el momento cuando el promedio 
rápido cruza al promedio lento. 
3. El MA20 de los últimos dos períodos es 
menor al MA50 del último período? 
no: vuelve a comparar 
si: El MA20 es mayor al MA50?
..continúa 
no: vuelve a comparar 
si: el MA20 es menor al precio de compra? 
(ask) 
no: vuelve al inicio 
si: genera una orden de compra 
4. Compara el precio de compra con el precio 
actual de mercado (bid)
...continúa 
el bid es mayor al parámetro de toma de utilidades? 
no: vuelve a comparar 
si: cierra la posición de compra 
el bid es menor al parámetro de riesgo: 
no: vuelve a comparar 
si: cierra la posición de compra 
5. fin
Diagrama de flujo: 
Inicio 
Compara el valor 
del MA20 vs 
MA50 de DOS 
periodos 
anteriores 
MA20 < 
no MA50 
Compara el valor 
del MA20 vs 
MA50 de UN 
periodo anterior 
MA20 > 
MA50 
Compara el 
MA20 vs ask 
MA20 
< ask ? 
Genera 
orden 
BUY 
Compara el 
ask 
ejecutado vs 
bid actual 
Ejecuta 
la salida 
si 
no 
no 
si 
si

Más contenido relacionado

Último

sistema de postratamiento para sistema isx15.pptx
sistema de postratamiento para sistema isx15.pptxsistema de postratamiento para sistema isx15.pptx
sistema de postratamiento para sistema isx15.pptx
masterbalam269
 
manual Renault Sandero Stepway. Privilege pdf
manual Renault Sandero Stepway. Privilege pdfmanual Renault Sandero Stepway. Privilege pdf
manual Renault Sandero Stepway. Privilege pdf
ssuserccc3a8
 
sistema de encendido transistorizado sin contacto por induccion.pdf
sistema de encendido transistorizado sin contacto por induccion.pdfsistema de encendido transistorizado sin contacto por induccion.pdf
sistema de encendido transistorizado sin contacto por induccion.pdf
Jaire8
 
MANUAL DEL PROPIETARIO - KIA STONIC (5).pdf
MANUAL DEL PROPIETARIO - KIA STONIC (5).pdfMANUAL DEL PROPIETARIO - KIA STONIC (5).pdf
MANUAL DEL PROPIETARIO - KIA STONIC (5).pdf
Aarón Reyes
 
Fam ISX EGR,VGT-CM871.pdfl manual vgt,egr,cm871
Fam ISX  EGR,VGT-CM871.pdfl manual vgt,egr,cm871Fam ISX  EGR,VGT-CM871.pdfl manual vgt,egr,cm871
Fam ISX EGR,VGT-CM871.pdfl manual vgt,egr,cm871
jmorenocalderon343
 
COMPLETO trabajo para realizarun proyecto de grato de mecanica automotriz(1)...
COMPLETO  trabajo para realizarun proyecto de grato de mecanica automotriz(1)...COMPLETO  trabajo para realizarun proyecto de grato de mecanica automotriz(1)...
COMPLETO trabajo para realizarun proyecto de grato de mecanica automotriz(1)...
BenedictoAugustoRoja
 
Tractores agricolas de-Valtra-Linea-BM.pdf
Tractores agricolas de-Valtra-Linea-BM.pdfTractores agricolas de-Valtra-Linea-BM.pdf
Tractores agricolas de-Valtra-Linea-BM.pdf
WilsonVillena
 
jddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodk
jddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodkjddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodk
jddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodk
jhoanpepe08
 

Último (8)

sistema de postratamiento para sistema isx15.pptx
sistema de postratamiento para sistema isx15.pptxsistema de postratamiento para sistema isx15.pptx
sistema de postratamiento para sistema isx15.pptx
 
manual Renault Sandero Stepway. Privilege pdf
manual Renault Sandero Stepway. Privilege pdfmanual Renault Sandero Stepway. Privilege pdf
manual Renault Sandero Stepway. Privilege pdf
 
sistema de encendido transistorizado sin contacto por induccion.pdf
sistema de encendido transistorizado sin contacto por induccion.pdfsistema de encendido transistorizado sin contacto por induccion.pdf
sistema de encendido transistorizado sin contacto por induccion.pdf
 
MANUAL DEL PROPIETARIO - KIA STONIC (5).pdf
MANUAL DEL PROPIETARIO - KIA STONIC (5).pdfMANUAL DEL PROPIETARIO - KIA STONIC (5).pdf
MANUAL DEL PROPIETARIO - KIA STONIC (5).pdf
 
Fam ISX EGR,VGT-CM871.pdfl manual vgt,egr,cm871
Fam ISX  EGR,VGT-CM871.pdfl manual vgt,egr,cm871Fam ISX  EGR,VGT-CM871.pdfl manual vgt,egr,cm871
Fam ISX EGR,VGT-CM871.pdfl manual vgt,egr,cm871
 
COMPLETO trabajo para realizarun proyecto de grato de mecanica automotriz(1)...
COMPLETO  trabajo para realizarun proyecto de grato de mecanica automotriz(1)...COMPLETO  trabajo para realizarun proyecto de grato de mecanica automotriz(1)...
COMPLETO trabajo para realizarun proyecto de grato de mecanica automotriz(1)...
 
Tractores agricolas de-Valtra-Linea-BM.pdf
Tractores agricolas de-Valtra-Linea-BM.pdfTractores agricolas de-Valtra-Linea-BM.pdf
Tractores agricolas de-Valtra-Linea-BM.pdf
 
jddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodk
jddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodkjddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodk
jddkdoqkwodkoekdeokdkoekoedkeodkokdeokdeodk
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Sistema

  • 1. Creando un sistema de trading con promedios móviles
  • 2. Objetivo Crear un sistema de “trading” mediante un algoritmo basado en el indicador de análisis técnico Promedio Móvil, para crear un código y realizar pruebas hacia atrás en una plataforma de “trading”, y con ello validar su eficiencia.
  • 3. Parámetros promedio rápido de 20 períodos (MA20) promedio lento de 50 períodos (MA50) Aministración del dinero: Relación toma de utilidades a riesgo: 2 a 1
  • 4. Algoritmo Se genera una señal de compra cuando un promedio móvil rápido cruza un segundo promedio móvil lento y el cruce se encuentra debajo del precio.
  • 5. Condición para señal de compra Promedio lento: 50 períodos Promedio rápido: 20 períodos c) MA20 < Ask 0 1 2 b) MA20 > MA50 en shift 1 a) MA20 < MA50 en shift 2
  • 6. Pseudo código 1. Obtener los promedios móviles 2. Obtener el momento cuando el promedio rápido cruza al promedio lento. 3. El MA20 de los últimos dos períodos es menor al MA50 del último período? no: vuelve a comparar si: El MA20 es mayor al MA50?
  • 7. ..continúa no: vuelve a comparar si: el MA20 es menor al precio de compra? (ask) no: vuelve al inicio si: genera una orden de compra 4. Compara el precio de compra con el precio actual de mercado (bid)
  • 8. ...continúa el bid es mayor al parámetro de toma de utilidades? no: vuelve a comparar si: cierra la posición de compra el bid es menor al parámetro de riesgo: no: vuelve a comparar si: cierra la posición de compra 5. fin
  • 9. Diagrama de flujo: Inicio Compara el valor del MA20 vs MA50 de DOS periodos anteriores MA20 < no MA50 Compara el valor del MA20 vs MA50 de UN periodo anterior MA20 > MA50 Compara el MA20 vs ask MA20 < ask ? Genera orden BUY Compara el ask ejecutado vs bid actual Ejecuta la salida si no no si si