NexusFi: Find Your Edge


Home Menu

 





Methods bar-related


Discussion in NinjaTrader

Updated
    1. trending_up 1,114 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?
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
April Jobs Beat Flips Fed Hike Odds Past 52% for First T …
Traders Hideout
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
3 thanks
  #2 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 6,270 since Sep 2015
Thanks Given: 15,951
Thanks Received: 16,192


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