Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

help coding from esignal

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    help coding from esignal

    I am coming over from esignal. I need help writing a simple code for ninja charts to alert. can some one please help. here is my esignal code

    //{{Declarations
    var vLastAlert = -1;
    //}}Declarations

    var AlertTTriggered = false; //added to cancel for the day
    function preMain() {

    /**
    * This function is called only once, before any of the bars are loaded.
    * Place any study or EFS configuration commands here.
    */
    //{{PreMain
    setPriceStudy(true);
    setStudyTitle("");
    var AlertTriggered = false;

    //}}PreMain
    }

    function main() {
    /**
    * The main() function is called once per bar on all previous bars, once per
    * in your preMain(), it is also called on every tick.
    */
    if (getDay(0) !=getDay(-1)){
    AlertTTriggered = false; //added to cancel for the day
    }

    //Following is to compare any bar to the first bar of the day (need to set time template as desired)
    var BarTime = rawtime(-1);
    var BarIndex = (getFirstBarIndexOfDay(BarTime)-getCurrentBarIndex());
    var FirstOpen = open(BarIndex);
    var FirstHigh = high(BarIndex);
    var FirstClose = close(BarIndex);
    var FirstLow = low(BarIndex);
    if(getBarState()==BARSTATE_NEWBAR)
    {
    }
    AlertTriggered = false;
    {

    //{{Expressions
    //{{Expression 1: For GL

    if(
    ((getHour(0)*100)+getMinute(0)>936 && (getHour(0)*100)+getMinute(0) <1530)&&


    low(-1) > low(-2) &&
    high(-1) <= high(-2) &&
    high(0) > high(-1) &&

    AlertTTriggered == false &&
    AlertTriggered == false
    ) onAction1();
    //}}Ends GL - 9:30 L10 Version.




    //}}Expressions: ENDS ALL Scripts Condition Statements Here


    //{{Return
    return null;
    //}}Return

    }

    function postMain() {

    }

    //{{Actions

    //{{Action_1 GL
    function onAction1() {
    drawTextRelative(-1, low(-1)-.060, "RV", Color.RGB(0,0,255), Color.RGB(0,255,0), Text.FRAME, "Arial", 10);
    drawLineRelative(-1, close(-1) , 8, close(-1) , PS_SOLID, 3,Color. green, "line");
    Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\l10setup.wav");
    Alert.addToList(getSymbol()+","+getInterval(),"GL Setup",Color.black,Color.blue);
    AlertTTriggered = true;
    vLastAlert = 1;
    }
    //}}Action_1 GL






    //}}Actions

    //END OF PROGRAM
    }
    Last edited by mitwave00; 04-15-2011, 02:26 PM.

    #2
    Hello mitwave00,

    Welcome to the NinjaTrader forums!

    If you are unable to get a response from the community here, you may consider hiring one of our 3rd party NinjaScript consultants to do the conversion for you.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    53 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    33 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    5 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    19 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    6 views
    0 likes
    Last Post cre8able  
    Working...
    X