NexusFi: Find Your Edge


Home Menu

 





Possible issue with Buy, sell, and net volume


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ratfink with 8 posts (4 thanks)
    2. looks_two Cheech with 7 posts (4 thanks)
    3. looks_3 Cilla with 3 posts (2 thanks)
    4. looks_4 memonic with 3 posts (0 thanks)
    1. trending_up 4,818 views
    2. thumb_up 10 thanks given
    3. group 4 followers
    1. forum 22 posts
    2. attach_file 2 attachments




 
Search this Thread

Possible issue with Buy, sell, and net volume

  #21 (permalink)
 Cheech 
Mesa, AZ/USA
 
Experience: Intermediate
Platform: NinjaTrader, ThinkorSwim
Broker: AMP Futures/CQG, TDA
Trading: Currency Futures, my Harley Davidson
Posts: 107 since Jun 2012
Thanks Given: 43
Thanks Received: 133


memonic View Post
Hi Cheech
thanks for your indicator. I would like to use in strategy backtesting with Tick replay. Nt8 ask me an erro "on state change"

fpgBuySellNetVolume_V21 = fpgBuySellNetVolume_V2(Close, fpgBuySellNetVolumeMAsType.EMA, 15, 50, 0, fpgBuySellNetVolumeMAsSmoothType.SMA, 5, 0, 0);

Do you know where could be the error.
thanks in advance


Hi:

Please give me more setup details (instrument, indicator, chart settings, etc.) and I'll try to replicate the problem on my system.

Thx

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
Strategy stop orders partially filled
EasyLanguage Programming
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
What is Markets Chat (markets.chat) real-time trading ro …
19 thanks
GFIs1 1 DAX trade per day journal
15 thanks
ApexTraderFunding.com experience and review
15 thanks
EG Indicators
11 thanks
  #22 (permalink)
 memonic 
Jaén Spain
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Emini ES
Posts: 8 since Aug 2017
Thanks Given: 10
Thanks Received: 0

Hi cheech.

Thanks for your answer, at following you can view the strategy, the problen is onstatechage

regards




#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.Indicators;
using NinjaTrader.NinjaScript.DrawingTools;
#endregion

//This namespace holds Strategies in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Strategies
{
public class estrategiabuyselpower : Strategy
{
private NinjaTrader.NinjaScript.Indicators.Cheech.fpgBuySellNetVolume_V2 fpgBuySellNetVolume_V21;

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "estrategiabuyselpower";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = false;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 1;
StartBehavior = StartBehavior.WaitUntilFlat;
TimeInForce = TimeInForce.Gtc;
TraceOrders = false;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
}
else if (State == State.Configure)
{
SetStopLoss(CalculationMode.Ticks, SLc);
//SetParabolicStop(CalculationMode.Ticks, SLc);
SetProfitTarget(CalculationMode.Ticks, PTc);
}
else if (State == State.DataLoaded)
{
fpgBuySellNetVolume_V21 = fpgBuySellNetVolume_V2(Close, fpgBuySellNetVolumeMAsType.EMA, 15, 50, 0, fpgBuySellNetVolumeMAsSmoothType.SMA, 5, 0, 0);
}
}

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

if (CurrentBars[0] < 1)
return;

// Set 1
if ((IsRising(fpgBuySellNetVolume_V21.FastNetMA[0])==true)
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}


}

#region Properties
[NinjaScriptProperty]
[Range(double.MinValue, double.MaxValue)]
[Display(Name="Limite", Order=1, GroupName="Parameters")]
public double Limite
{ get; set; }

[NinjaScriptProperty]
[Range(int.MinValue, int.MaxValue)]
[Display(Name="Uno", Order=2, GroupName="Parameters")]
public int Uno
{ get; set; }

[NinjaScriptProperty]
[Range(int.MinValue, int.MaxValue)]
[Display(Name="Dos", Order=3, GroupName="Parameters")]
public int Dos
{ get; set; }

[NinjaScriptProperty]
[Range(int.MinValue, int.MaxValue)]
[Display(Name="periododema", Order=4, GroupName="Parameters")]
public int periododema
{ get; set; }

[NinjaScriptProperty]
[Range(int.MinValue, int.MaxValue)]
[Display(Name="PTc", Order=5, GroupName="Parameters")]
public int PTc
{ get; set; }

[NinjaScriptProperty]
[Range(int.MinValue, int.MaxValue)]
[Display(Name="SLc", Order=6, GroupName="Parameters")]
public int SLc
{ get; set; }
#endregion

}
}

Reply With Quote
  #23 (permalink)
 memonic 
Jaén Spain
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Emini ES
Posts: 8 since Aug 2017
Thanks Given: 10
Thanks Received: 0



Cheech View Post
Hi:

Please give me more setup details (instrument, indicator, chart settings, etc.) and I'll try to replicate the problem on my system.

Thx

hi cheech do you have any idea what the problem is?

thanks in advance

Reply With Quote




Last Updated on July 12, 2019


© 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