Jump to content

Hacker1713006064

Members
  • Posts

    278
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Hacker1713006064 got a reaction from swordfish in ECN Brokers outside the US taking US customer?   
    This is a thing I have used for a while.
     
    http://www.multiupload.com/F4HT440B42
  2. Like
    Hacker1713006064 got a reaction from gringoh in Icustom? how to return a value from another indicator?   
    Im a real fan of passing values between modules using the GlobalVariables
    You do this using
     
    GlobalVariableCheck
    GlobalVariableSet
    GlobalVariableDel
     
    Commands...
     
    Inside one indicator you calculate/set a global variable to the value you want... And then inside the other module you check the global variable and use the returned value for you needs.
     
     
    Here is an example I use in an indicator to tell an ea when it OK to trade..
     
    //use global flags to signal time to trade to ea.
    GlobalOkToTradeSymbolFlag="GlobalTradeFlag_"+MagicNumber;
     
     
    if (GlobalVariableCheck(GlobalOkToTradeSymbolFlag)) GlobalVariableDel(GlobalOkToTradeSymbolFlag);
     
    for(int cnt=1; cnt<=5; cnt++)
    {
    if (DebugLogFile) log( "Setting GlobalOkToTradeSymbolFlag - Try#: " +cnt+" "+Symbol()+ " "+ Period() );
    Error = GetLastError();
    GlobalVariableSet(GlobalOkToTradeSymbolFlag,0);
    Error = GetLastError();
    if (Error>0)
    {
    GlobalSymbolTrend=99;
    if (DebugLogFile) log (" GlobalOkToTradeSymbolFlag Error: " + ErrorDescription(Error));
    Sleep(500);
    }
    else
    {
    GlobalSymbolTrend=0;
    if (DebugLogFile) log (" GlobalOkToTradeSymbolFlag SetOK: " + GlobalSymbolTrend);
    break;
    }
    }
     
    I also record a log file on my stuff so you will see code in here for error debugging
     
    Now the EA has similiar code in it to READ the global variable an do actions based on that...
×
×
  • Create New...