Brussels Belgium
Experience: Beginner
Platform: Ninjatrader
Broker: GAINCAPITAL/Forex.com
Trading: Forex
Posts: 14 since Mar 2013
Thanks Given: 5
Thanks Received: 0
|
Hello to you,
I’m obviously breaking a rule using the managed approach
I’m not really good at reading “log file” thought I’m working hard on it
My initialise() section says
CalculateOnBarClose = true;
AddRenko("$EURJPY",5,MarketDataType.Last);
EntryHandling = EntryHandling.AllEntries;
SetStopLoss (CalculationMode.Ticks, Stop);
Meeting certain conditions My Strategy wants to send two orders (sometimes one order only and that works perfect)
TimeInForce is GTC
Let’s suppose we go long
A EnterLong() with a SetStopLoss() and a SetProfitTarget() tagged “Order1”
And in the same set of instruction
A EnterLongStop() tagged “Order2” let’s say X(value) above the entry price of the previous EnterLong() average filled price.
Both should Exit at the “Profit Target” of “Order1”
Here is the code generating the error
private void GoLong()
{
Print(ChartName + " ACHAT EST LANCE"+String.Format("{0:HH:mm:ss}",DateTime.Now)+" "+Price);
SetProfitTarget ("order1",CalculationMode.Ticks,Target);
EnterLong(Coef , "order1");
if(GainToReach > 65)// let’s suppose it is above 65
And now I Hit the problem
{
startPice = Positions[0].AvgPrice + Xparam*TickSize;
Print("startPice "+startPice);
orderStopName = "LongOrderStop";
SetProfitTarget (orderStopName,CalculationMode.Ticks,Yparam);
EnterLongStop(startPice,orderStopName);
}
}
It compiles nice and beautiful
Coef , X , Y have a printout in the output windows and are certified “Clean”
Witch rule do I break
Thanks in advance
|