NexusFi: Find Your Edge


Home Menu

 





Strategy only printing signals historically; no signals on live market.


Discussion in NinjaTrader

Updated
    1. trending_up 320 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 9 posts
    2. attach_file 4 attachments




Closed Thread
 
Search this Thread

Strategy only printing signals historically; no signals on live market.

  #1 (permalink)
 
Bullywig's Avatar
 Bullywig 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: FDAX, NQ, HG, SI, CL
Posts: 68 since Oct 2015
Thanks Given: 42
Thanks Received: 22

Can I post about a strategy I am trying to create? I am stuck, and not sure what to add to the code to resolve this issue. The signals for the strategy print out correctly on historical chart information, but never going forward on a live market. I know I am missing something, but not sure how to resolve it. Thanks in advance if anyone can point me in the right direction.

Started this thread

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
Trend Direction Force Index (TDFI)
Platforms and Indicators
How to apply profiles
Traders Hideout
 
  #2 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747


Bullywig View Post
Can I post about a strategy I am trying to create? I am stuck, and not sure what to add to the code to resolve this issue. The signals for the strategy print out correctly on historical chart information, but never going forward on a live market. I know I am missing something, but not sure how to resolve it. Thanks in advance if anyone can point me in the right direction.

Where is the strategy?
Nothing attached

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter
Thanked by:
  #3 (permalink)
 
Bullywig's Avatar
 Bullywig 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: FDAX, NQ, HG, SI, CL
Posts: 68 since Oct 2015
Thanks Given: 42
Thanks Received: 22


Here is the CS file. Thanks for any help in advance.

Attached Files
Elite Membership required to download: VTCDSv1.cs
Started this thread
  #4 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747


Bullywig View Post
Here is the CS file. Thanks for any help in advance.

Please add CumDelta.
Or tell me where to download it.

I do not have this on my system to test it
Thanks

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter
Thanked by:
  #5 (permalink)
 
Bullywig's Avatar
 Bullywig 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: FDAX, NQ, HG, SI, CL
Posts: 68 since Oct 2015
Thanks Given: 42
Thanks Received: 22

Here is the cum delta cs

Attached Files
Elite Membership required to download: CumDelta.cs
Started this thread
  #6 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747

what time frame is your chart?
Minute, day, renko, range, etc

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter
  #7 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747

I am short on time during the holiday but maybe this will get you started or perhaps someone else will post a solution.
Here are two issues:

There is no code to enter a trade:
i.e. EnterLong(); / EnterShort();

Also there is a logic error in the signal.

The strategy is trying to enter a trade on the current candle but using Close[1]/Open[1] as the trigger.

This means the signal has past in real time and will not trigger.
This can be done but the logic is not correct in the indicator.

You should use Print statements to be sure your parameters are correct on the currentbar.
Here are the parameters shown for the signal on the charts below:
VFST = -400
CumDelta1 = -17
EMA1 = -11.9509422153801
EMA2 = 16032.039996093
EMA3 = 16035.8225645426

I added the chart indicators so I could see the logic.
I could not add the EMA1 because it makes the chart unviewable (11.9)
I also added the backcolor on the signal candle

Here are two examples of the chart

Live


After live with manual refresh
Historical

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter
Thanked by:
  #8 (permalink)
 
Bullywig's Avatar
 Bullywig 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: FDAX, NQ, HG, SI, CL
Posts: 68 since Oct 2015
Thanks Given: 42
Thanks Received: 22

By the way, I run this on mean Renko or Uni renko bar charts.

Thanks for the response, but I am not following where the error is or how to use print statements? I will look to see if I can find something on print statements, but perhaps you can indulge me for a few more questions/observations? I appreciate your responses thus far. Very Helpful.

As far as I can tell, the trigger relies on 4 parameters. Are you saying that the if ((Close[1] < Open[1]) is the issue and that by being the first statement based on the previous bars data, causes the issue? It's followed by 3 && statements all based on the current bar.

Below, there are 4 parameter that cause the bar color change and the arrow. That's all I am seeking at this moment. No entry, target, or stop logic. I created most of this in the strategy builder, and added in the

( AddDataSeries(Data.BarsPeriodType.Tick, 1); )

based on something I found on the NT forum using the Ninjascript Editor, but still no signals in real time; just historic signals which all look correct on the chart when I apply the strategy, but only historically.

I'm still learning, so I appreciate any explanation to help me understand where I went astray.


protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;

if (CurrentBars[0] < 1)
return;

// Set 1
if ((Close[1] < Open[1])
&& (CumDelta1[0] > VFLT)
&& (EMA1[0] > TFLT)
&& (EMA2[0] > EMA3[0]))
{
Draw.ArrowUp(this, @"MyCustomStrategy Arrow up_1 " + Convert.ToString(CurrentBars[0]), false, 0, (Close[0] + 20) , Brushes.DodgerBlue);
BarBrush = Brushes.DeepPink;
}

// Set 2
if ((Close[1] > Open[1])
&& (CumDelta1[0] < VFST)
&& (EMA1[0] < TFST)
&& (EMA2[0] < EMA3[0]))
{
Draw.ArrowDown(this, @"VTES001 Arrow down_1 " + Convert.ToString(CurrentBars[0]), false, 0, (Close[0] - 20) , Brushes.Red);
BarBrush = Brushes.DeepPink;
}

}

Started this thread
  #9 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747

Because this was created in Strategy Builder it may have put a lot of code that was not necessary.
I suggest you post your request here:


As far as using print statements you add this to your code in places you want to see the values of the indicators used:
For example: post the prints you want to see after the Draw.Arrow command or any place you want to see the values.

 
Code
Print("UP");
Print("VFLT = "+VFLT);
Print("CumDelta1 = "+CumDelta1[0]);
Print("EMA1 = "+EMA1[0]);	
Print("EMA2 = "+EMA2[0]);	
Print("EMA3 = "+EMA3[0]);

Bullywig View Post
By the way, I run this on mean Renko or Uni renko bar charts.

Thanks for the response, but I am not following where the error is or how to use print statements? I will look to see if I can find something on print statements, but perhaps you can indulge me for a few more questions/observations? I appreciate your responses thus far. Very Helpful.

As far as I can tell, the trigger relies on 4 parameters. Are you saying that the if ((Close[1] < Open[1]) is the issue and that by being the first statement based on the previous bars data, causes the issue? It's followed by 3 && statements all based on the current bar.

Below, there are 4 parameter that cause the bar color change and the arrow. That's all I am seeking at this moment. No entry, target, or stop logic. I created most of this in the strategy builder, and added in the

( AddDataSeries(Data.BarsPeriodType.Tick, 1); )

based on something I found on the NT forum using the Ninjascript Editor, but still no signals in real time; just historic signals which all look correct on the chart when I apply the strategy, but only historically.

I'm still learning, so I appreciate any explanation to help me understand where I went astray.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter
Thanked by:
  #10 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,515
Thanks Received: 26,292


Hi @Bullywig,

I see that you have reposted in the free strategy thread, as advised by @DavidHP, as well as in another thread you have created.

Since you are receiving help in the strategy thread, I am closing the other two threads to prevent duplication of the topic.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote

Closed Thread



Last Updated on November 27, 2023


© 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