NexusFi: Find Your Edge


Home Menu

 





I need help in my Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one fernando 2014 with 4 posts (0 thanks)
    2. looks_two ClimberMel with 2 posts (2 thanks)
    3. looks_3 shodson with 1 posts (2 thanks)
    4. looks_4 Emet Trading with 1 posts (0 thanks)
    1. trending_up 1,492 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

I need help in my Strategy

  #1 (permalink)
fernando 2014
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.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Are there any eval firms that allow you to sink to your …
Traders Hideout
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Deepmoney LLM
Elite Quantitative GenAI/LLM
Build trailing stop for micro index(s)
Psychology and Money Management
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #3 (permalink)
 
shodson's Avatar
 shodson 
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 View Post
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í

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
ClimberMel
Vancouver Canada
 
Posts: 9 since Dec 2011
Thanks Given: 1
Thanks Received: 6


fernando 2014 View Post
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

Reply With Quote
Thanked by:
  #5 (permalink)
fernando 2014
Barcelona Spain
 
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0


ClimberMel View Post
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

Reply With Quote
  #6 (permalink)
ClimberMel
Vancouver Canada
 
Posts: 9 since Dec 2011
Thanks Given: 1
Thanks Received: 6


fernando 2014 View Post
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

Reply With Quote
Thanked by:
  #7 (permalink)
fernando 2014
Barcelona Spain
 
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0


ClimberMel View Post
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

}
}

""

Reply With Quote
  #8 (permalink)
fernando 2014
Barcelona Spain
 
Posts: 6 since Nov 2014
Thanks Given: 4
Thanks Received: 0

Finally I solve my self tahnaks anywaya Friends

Reply With Quote




Last Updated on January 15, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts