NexusFi: Find Your Edge


Home Menu

 





Methods bar-related


Discussion in NinjaTrader

Updated
    1. trending_up 1,044 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
user10
Dresden + Germany
 
Posts: 21 since Feb 2018
Thanks Given: 11
Thanks Received: 5

Hello to the forum,

so far I have programmed equilla. With this programming language,
I was able to develop functions that could be used by any workspace.

I would now like to develop in Ninjatrader 8 methods that avoid multiple calculations and can be used by all strategies.


I have programmed a small example with which I would like to read the number of price changes from different strategies.

 
Code
                            
// inner nested organizing class

public class Methoden
    
{
//        private int counterTest;
                
        
public static double CountDelta(double firstPricedouble secondPrice)
            {
                
int counter 1// ?? // counterTest ??
                
if (firstPrice != secondPricecounter++;
                return 
counter;
            }
        } 
Unfortunately, I get no value over 1.
How do I correctly initialize Counter?

The support tells me that a method can not be bar-related. Is that correct?

How would you solve such a problem?

Apart from time-related methods, I found no further examples of methods. Why?

Thank you for the support!

Kay


PS: The example has no special meaning; I am concerned with the question of whether and how I can count and evaluate events from different strategies.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
BofA Projects $1.1 Trillion in Sports Event Contracts -- …
Prediction Markets & Event Contracts
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
US Treasury Weighs Direct Oil Futures Market Interventio …
Commodities
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 6,233 since Sep 2015
Thanks Given: 15,885
Thanks Received: 16,118


user10 View Post
How would you solve such a problem?

Apart from time-related methods, I found no further examples of methods. Why?

Thank you for the support!

Kay


Hi Kay,

I have moved your question to the NinjaTrader Programming section, hoping it will attract more viewers who are able to address your question.

Good luck.


Reply With Quote
Thanked by:




Last Updated on April 26, 2019


© 2026 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 - Downloads - Top
no new posts