Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I need help in my Strategy
Updated January 15, 2015
I need help in my Strategy
December 18th, 2014, 02:04 PM
Barcelona Spain
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0
Hello friends I have a small problem and hope for help me to solve it ...
I have designed a estartegy that gives very good results but I put it to work is not executed and can only use copying their movements with one minute late.
Could you tell me how to make it work in automatic way
many graccias
Deputy picture of the results it gives me a year, with 10 per operation.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
December 18th, 2014, 05:53 PM
OC, California, USA
Quantoholic
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709
fernando 2014
Hello friends I have a small problem and hope for help me to solve it ...
I have designed a estartegy that gives very good results but I put it to work is not executed and can only use copying their movements with one minute late.
Could you tell me how to make it work in automatic way
many graccias
Deputy picture of the results it gives me a year, with 10 per operation.
You need to find or hire a programmer to automate your strategy, or learn how to program a strategy yourself. Follow this link
En español: necesitas encontrar alguíen que puede programar o automatizar tu estrategia. Sigue aquí
January 5th, 2015, 04:42 PM
Vancouver Canada
Posts: 9 since Dec 2011
Thanks Given: 1
Thanks Received: 6
fernando 2014
Hello friends I have a small problem and hope for help me to solve it ...
I have designed a estartegy that gives very good results but I put it to work is not executed and can only use copying their movements with one minute late.
Could you tell me how to make it work in automatic way
many graccias
Deputy picture of the results it gives me a year, with 10 per operation.
Does it compile? I can look at it if you'd like. You would have to tell me how it is supposed to work and then I could tell you why it doesn't
ClimberMel
January 6th, 2015, 03:42 AM
Barcelona Spain
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0
ClimberMel
Does it compile? I can look at it if you'd like. You would have to tell me how it is supposed to work and then I could tell you why it doesn't
ClimberMel
Yes ,I can compile perfectly and I can do a bactesting for a year and I have a very good results , around 80.000 euros only buying 1 action .But when I try to do the same in realtime , the strategy never works is all time stoped .
Tell me how can I show you the strategy if you want have a look , thanks a lot
PD:spikoloco no puedo enviarte mensages privados , no me deja , diem que necesitas para ayudarme amigo , gracias
January 6th, 2015, 01:22 PM
Vancouver Canada
Posts: 9 since Dec 2011
Thanks Given: 1
Thanks Received: 6
fernando 2014
Yes ,I can compile perfectly and I can do a bactesting for a year and I have a very good results , around 80.000 euros only buying 1 action .But when I try to do the same in realtime , the strategy never works is all time stoped .
Tell me how can I show you the strategy if you want have a look , thanks a lot
PD:spikoloco no puedo enviarte mensages privados , no me deja , diem que necesitas para ayudarme amigo , gracias
You can upload it or if you'd rather not post it, you could email it to me. Then I can go through it and see why it won't run in real time.
ClimberMel
at gmail
January 6th, 2015, 02:08 PM
Barcelona Spain
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0
ClimberMel
You can upload it or if you'd rather not post it, you could email it to me. Then I can go through it and see why it won't run in real time.
ClimberMel
at gmail
ok here it is the strategy ...
Tthanks for your help anyway
As you could see it is correct but never run in real time I have to reload ninja script every minute wiht hot key to follow it and win money .So heavy to do every time like this .
But the back testing it is so good ...
""
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader .Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Macd estrategia ")]
public class ESESTRATEGIA : Strategy
{
//#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
private int Target1 = 100;
private int cierrocompra = 0;
private int cierroventa=0;
private int compra =0;
private bool compro=false;
private bool vendo=false;
private int Stop = 50;
private bool _playAlert;
private string _longAlert = "Alert4.wav";
private string _shortAlert = "Alert4.wav";
private double a=0;
private int mostrar =0;
private int mostrar2 =0;
private double sumayi =0;
private double sumaxi =0;
private double n=1;
private double xm=0;
private double ym=0;
private double difxi=0;
private double difyi=0;
private double xi=0;
private double yi=0;
private double cuadrados=0;
private double divisor=0;
private double dividendo=0;
private double productoxy=0;
private double b=0;
private double final=0;
private int finalint=0;
private double y=0;
private double xo=0;
private double yo=0;
private double xf=0;
private double yf=0;
private double ygo=0;
private double ygf=0;
private double p=0;
private double yregresion=0;
private int intervaloreg=1;
private bool alertOnBreak=true;
private bool showHistory=true;
private int strength=1;
private int Signal=1;
//#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
Add(MACD(12, 26, 9));
Add(RSI(14, 3));
Add(SMMA(50));
CalculateOnBarClose = true;
TraceOrders = true;
}
private void GoLong()
{
SetStopLoss("CierreStoplossC", CalculationMode.Price, Close[0] - (Stop*TickSize), false);
SetProfitTarget("ObjetivoC", CalculationMode.Price, Close[0] + (Target1*TickSize));
EnterLong(10);
PlaySound(LongAlert);
Print("!!!!!!!!! ESESTRATEGIA---------> COOOOOMPROOOOOOOOO !!!!!!!!");
Print(Time[0]);
}
private void GoShort()
{
SetStopLoss("CierreStopV", CalculationMode.Price, Close[0] + (Stop*TickSize), false);
SetProfitTarget("ObjetivoV", CalculationMode.Price, Close[0] - (Target1*TickSize));
EnterShort(10);
PlaySound(LongAlert);
PlaySound(LongAlert);
Print("!!!!!!ESESTRATEGIA---------> VEEEENDOOOOOOOOOOOOOOOOOO!!!!!!!!!" + Close[0]);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
///
protected override void OnBarUpdate()
{
Megan();
}
private void Megan()
/// protected override void OnBarUpdate()
{
// Condition set 1
Print(" ES estrategia avanzando "+ Close[0]);
{
if (MACD(12, 26, 9).Avg[5] > MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] <= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] < MACD(12, 26, 9)[-1]
&& Close[-1] > Close[0])
{
if (Close[-1]-Close[0]>=1.2)
{
if (Position.MarketPosition == MarketPosition.Flat )
{
GoLong();
;
}
if (Position.MarketPosition == MarketPosition.Short)
{
ExitShort();
GoLong();
}
}
}
}
if (MACD(12, 26, 9).Avg[5] < MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] >= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] > MACD(12, 26, 9)[-1]
&& Close[-1] > Close[0])
{
if (Position.MarketPosition == MarketPosition.Long)
{
ExitLong(10);
Print("!!!!!ESESTRATEGIA CIERROOOOOOOOOOOOOOOOOOOOOOOO COMPRAAAAAAAAA!!!! !!!!!! " + Close[0]);
}
}
if (MACD(12, 26, 9).Avg[5] < MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] >= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] > MACD(12, 26, 9)[-1]
&& Close[-1] < Close[0])
{ if (Position.MarketPosition == MarketPosition.Long)
{
ExitLong(10);
Print("!!!!ESESTRATEGIA CIERROOOOOOOOOOOOOOOOOOOOOOOO COMPRAAAAAAAAA !!!!!!" + Close[0]);
}
if (MACD(12, 26, 9).Avg[5] < MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] >= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] > MACD(12, 26, 9)[-1]
&& Close[-1] < Close[0])
{
if (Close[0]-Close[-1]>=1.2)
{
if (Position.MarketPosition == MarketPosition.Flat)
{
GoShort();
}
if (Position.MarketPosition == MarketPosition.Long)
{
ExitLong();
GoShort();
}
}
}
}
// Filtro 1
if (MACD(12, 26, 9).Avg[5] < MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] >= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] > MACD(12, 26, 9)[-1]
&& Close[-1] < Close[0])
{
if (Close[0]-Close[-1]>=1.2)
{
if (Position.MarketPosition == MarketPosition.Flat)
{
GoShort();
}
if (Position.MarketPosition == MarketPosition.Long)
{
ExitLong();
GoShort();
}
}
}
if (MACD(12, 26, 9).Avg[5] > MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] <= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] < MACD(12, 26, 9)[-1]
&& Close[-1] < Close[0])
{
if (Position.MarketPosition == MarketPosition.Flat)
{
}
if (Position.MarketPosition == MarketPosition.Short)
{
ExitShort(10);
Print("!!!!ESESTRATEGIA CIERROOOOOOOOOOOOOOOOOOOOOOOO VENTAAAAAAAAAA!!!!!!" + Close[0]);
}
}
if (MACD(12, 26, 9).Avg[5] > MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] <= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] < MACD(12, 26, 9)[-1]
&& Close[-1] > Close[0])
{
if (Position.MarketPosition == MarketPosition.Flat)
{
}
if (Position.MarketPosition == MarketPosition.Short)
{
ExitShort(10);
Print("!!!!ESESTRATEGIA CIERROOOOOOOOOOOOOOOOOOOOOOOO VENTAAAAAAAAA!!!!!!" + Close[0]);
}
if (MACD(12, 26, 9).Avg[5] > MACD(12, 26, 9)[5]
&& MACD(12, 26, 9).Avg[0] <= MACD(12, 26, 9)[0]
&& MACD(12, 26, 9).Avg[-1] < MACD(12, 26, 9)[-1]
&& Close[-1] > Close[0])
{
if (Close[-1]-Close[0]>=1.2)
{
if (Position.MarketPosition == MarketPosition.Short)
{
ExitShort();
GoLong();
}
if (Position.MarketPosition == MarketPosition.Flat)
{
GoLong();
}
}
}
}
}
#region Properties
public bool PlayAlert
{
get { return _playAlert; }
set { _playAlert = value; }
}
public string LongAlert
{
get { return _longAlert; }
set { _longAlert = value; }
}
public string ShortAlert
{
get { return _shortAlert; }
set { _shortAlert = value; }
}
#endregion
}
}
""
January 15th, 2015, 05:37 AM
Barcelona Spain
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0
Finally I solve my self tahnaks anywaya Friends
Last Updated on January 15, 2015