Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    581 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    336 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X