NexusFi: Find Your Edge


Home Menu

 





Methods bar-related


Discussion in NinjaTrader

Updated
    1. trending_up 737 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?
MC Advanced Simulated Trading.
MultiCharts
What You Know vs How much you know about it
Traders Hideout
How to plot a custom icon for crossover
NinjaTrader
tick data interval discrepancy
NinjaTrader
Elite Trader Funding, Avoid?
Trading Reviews and Vendors
 
  #2 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 6,011 since Sep 2015
Thanks Given: 15,592
Thanks Received: 15,556


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


© 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